diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index d9b75725257..bd3450fffd1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2019-08-13 Ed Schonberg + + * sem_ch8.adb (Analyze_Subprogram_Renaming): Do no suppress mode + conformance checks on child unit instance that is a compilation + unit. + 2019-08-13 Gary Dismukes * exp_dbug.adb (Fully_Qualify_Name): Add full name qualification diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb index 8795dc07f95..38c3980278d 100644 --- a/gcc/ada/sem_ch8.adb +++ b/gcc/ada/sem_ch8.adb @@ -3368,7 +3368,16 @@ package body Sem_Ch8 is if CW_Actual then null; - elsif not Is_Actual or else No (Enclosing_Instance) then + + -- No need for a redundant error message if this is a nested + -- instance, unless the current instantiation (of a child unit) + -- is a compilation unit, which is not analyzed when the parent + -- generic is analyzed. + + elsif not Is_Actual + or else No (Enclosing_Instance) + or else Is_Compilation_Unit (Current_Scope) + then Check_Mode_Conformant (New_S, Old_S); end if;