https://gcc.gnu.org/g:3e01dfa72623ede64ff2e92f6852d1fd07e8898d
commit r15-260-g3e01dfa72623ede64ff2e92f6852d1fd07e8898d Author: Piotr Trojanek <troja...@adacore.com> Date: Tue Jan 16 13:07:20 2024 +0100 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: --- 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