Index: sem_ch3.adb =================================================================== --- sem_ch3.adb (revision 212728) +++ sem_ch3.adb (working copy) @@ -2366,11 +2366,14 @@ -- Analyze the contracts of subprogram declarations, subprogram bodies -- and variables now due to the delayed visibility requirements of their - -- aspects. + -- aspects. Skip analysis if the declaration already has an error. Decl := First (L); while Present (Decl) loop - if Nkind (Decl) = N_Object_Declaration then + if Error_Posted (Decl) then + null; + + elsif Nkind (Decl) = N_Object_Declaration then Analyze_Object_Contract (Defining_Entity (Decl)); elsif Nkind_In (Decl, N_Abstract_Subprogram_Declaration, Index: sem_ch8.adb =================================================================== --- sem_ch8.adb (revision 212726) +++ sem_ch8.adb (working copy) @@ -706,6 +706,14 @@ Error_Msg_N ("within its scope, generic denotes its instance", N); end if; + -- For subprograms, propagate the Intrinsic flag, to allow, e.g. + -- renamings and subsequent instantiations of Unchecked_Conversion. + + if Ekind_In (Old_P, E_Generic_Function, E_Generic_Procedure) then + Set_Is_Intrinsic_Subprogram + (New_P, Is_Intrinsic_Subprogram (Old_P)); + end if; + Check_Library_Unit_Renaming (N, Old_P); end if;