From 3e01dfa72623ede64ff2e92f6852d1fd07e8898d Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 16 Jan 2024 13:07:20 +0100 Subject: [PATCH] ada: Simplify detection of the enclosing scope Code cleanup; behaviour is unaffected. gcc/ada/ * sem_attr.adb (Analyze_Access_Attribute): Replace loop with Current_Scope_No_Loops. --- gcc/ada/sem_attr.adb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 6140cc0c0d6..e80a144ebb2 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -988,10 +988,7 @@ package body Sem_Attr is -- expanded into a loop. Locate scope of type definition, -- if any. - Scop := Current_Scope; - while Ekind (Scop) = E_Loop loop - Scop := Scope (Scop); - end loop; + Scop := Current_Scope_No_Loops; -- OK if we are within the scope of a limited type -- let's mark the component as having per object constraint -- 2.47.2