Performing null exclusion checks on generated entities can result in bogus error messages.
Tested on x86_64-pc-linux-gnu, committed on trunk gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Add Comes_From_Source call.
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -4055,7 +4055,7 @@ package body Sem_Ch3 is then null; - else + elsif Comes_From_Source (Id) then declare Save_Typ : constant Entity_Id := Etype (Id); begin