From: Piotr Trojanek Date: Tue, 6 Apr 2021 11:10:01 +0000 (+0200) Subject: [Ada] Simplify detection of local types X-Git-Tag: basepoints/gcc-13~6427 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32638d4975f2768b25732f87b4708360117ef0fd;p=thirdparty%2Fgcc.git [Ada] Simplify detection of local types gcc/ada/ * sem_ch3.adb (Is_Local_Type): Simplify by reusing Scope_Within. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 98cbef483db1..70e1dfdb71da 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -19133,21 +19133,8 @@ package body Sem_Ch3 is ------------------- function Is_Local_Type (Typ : Entity_Id) return Boolean is - Scop : Entity_Id; - begin - Scop := Scope (Typ); - while Present (Scop) - and then Scop /= Standard_Standard - loop - if Scop = Scope (Current_Scope) then - return True; - end if; - - Scop := Scope (Scop); - end loop; - - return False; + return Scope_Within (Inner => Typ, Outer => Scope (Current_Scope)); end Is_Local_Type; -- Start of processing for Is_Visible_Component