diff options
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 29 |
1 files changed, 3 insertions, 26 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 50c9d3d..88ef267 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -16300,34 +16300,11 @@ package body Sem_Ch3 is then return True; - -- If we are in the body of an instantiation, the component is visible - -- if the parent type is non-private, or in an enclosing scope. The - -- scope stack is not present when analyzing an instance body, so we - -- must inspect the chain of scopes explicitly. + -- In the body of an instantiation, no need to check for the visibility + -- of a component. elsif In_Instance_Body then - if not Is_Private_Type (Scope (C)) then - return True; - - else - declare - S : Entity_Id; - - begin - S := Current_Scope; - while Present (S) - and then S /= Standard_Standard - loop - if S = Type_Scope then - return True; - end if; - - S := Scope (S); - end loop; - - return False; - end; - end if; + return True; -- If the component has been declared in an ancestor which is currently -- a private type, then it is not visible. The same applies if the |