2020-06-04 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_attr.adb (Resolve_Attribute) <Access>: Do not generate
the secondary message about a missing pragma if the convention
of the prefix is Intrinsic.
* sem_ch12.adb (Instantiate_Formal_Subprogram): Only set the
Convention and the Is_Inlined flag on a null procedure.
if not Is_Itype (Btyp)
and then not Has_Convention_Pragma (Btyp)
+ and then Convention (Entity (P)) /= Convention_Intrinsic
then
Error_Msg_FE
("\probable missing pragma Convention for &",
Make_Handled_Sequence_Of_Statements (Loc,
Statements => New_List (Make_Null_Statement (Loc))));
- Set_Is_Intrinsic_Subprogram (Defining_Unit_Name (New_Spec));
+ -- RM 12.6 (16 2/2): The procedure has convention Intrinsic
+
+ Set_Convention (Defining_Unit_Name (New_Spec), Convention_Intrinsic);
+
+ -- Eliminate the calls to it when optimization is enabled
+
+ Set_Is_Inlined (Defining_Unit_Name (New_Spec));
return Decl_Node;
else