From: Piotr Trojanek Date: Tue, 16 Jan 2024 12:07:20 +0000 (+0100) Subject: ada: Simplify detection of the enclosing scope X-Git-Tag: basepoints/gcc-16~9293 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e01dfa72623ede64ff2e92f6852d1fd07e8898d;p=thirdparty%2Fgcc.git 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. --- 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