Commit 6fdc25c4 by Arnaud Charlet

[multiple changes]

2017-05-02  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
	visibility rules for equality operators that apply within an
	instantiation apply within an inlined body.
	* sem_type.adb (Add_One_Interp): ditto.

2017-05-02  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
	procedures.

2017-05-02  Eric Botcazou  <ebotcazou@adacore.com>

	* snames.ads-tmpl
	(Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
	Name_No_Tagged_Streams): Move to regular pragmas.  Add
	placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
	and Secondary_Stack_Size.
	(Pragma_Id): Move Pragma_Assume,
	Pragma_Attribute_Definition, Pragma_Loop_Optimize and
	Pragma_No_Tagged_Streams to second part.

From-SVN: r247470
parent c0e938d0
2017-05-02 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Find_Equality_Types, Try_One_Interp): The same relaxed
visibility rules for equality operators that apply within an
instantiation apply within an inlined body.
* sem_type.adb (Add_One_Interp): ditto.
2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Forbid pragma Contract_Cases on null
procedures.
2017-05-02 Eric Botcazou <ebotcazou@adacore.com>
* snames.ads-tmpl
(Name_Assume, Name_Attribute_Definition, Name_Loop_Optimize,
Name_No_Tagged_Streams): Move to regular pragmas. Add
placeholders for Default_Scalar_Storage_Order, Dispatching_Domain,
and Secondary_Stack_Size.
(Pragma_Id): Move Pragma_Assume,
Pragma_Attribute_Definition, Pragma_Loop_Optimize and
Pragma_No_Tagged_Streams to second part.
2017-05-02 Hristian Kirtchev <kirtchev@adacore.com>
* exp_attr.adb: Minor reformatting.
......
......@@ -6476,7 +6476,7 @@ package body Sem_Ch4 is
-- Either the types are compatible, or one operand is universal
-- (numeric or null).
or else (In_Instance
or else ((In_Instance or else In_Inlined_Body)
and then
(First_Subtype (T1) = First_Subtype (Etype (R))
or else Nkind (R) = N_Null
......
......@@ -13422,6 +13422,7 @@ package body Sem_Prag is
when Pragma_Contract_Cases => Contract_Cases : declare
Spec_Id : Entity_Id;
Subp_Decl : Node_Id;
Subp_Spec : Node_Id;
begin
GNAT_Pragma;
......@@ -13462,7 +13463,19 @@ package body Sem_Prag is
-- Subprogram
elsif Nkind (Subp_Decl) = N_Subprogram_Declaration then
null;
Subp_Spec := Specification (Subp_Decl);
-- Pragma Contract_Cases is forbidden on null procedures, as
-- this may lead to potential ambiguities in behavior when
-- interface null procedures are involved.
if Nkind (Subp_Spec) = N_Procedure_Specification
and then Null_Present (Subp_Spec)
then
Error_Msg_N (Fix_Error
("pragma % cannot apply to null procedure"), N);
return;
end if;
else
Pragma_Misplaced;
......@@ -374,7 +374,7 @@ package body Sem_Type is
and then not Is_Hidden (Vis_Type))
or else Nkind (N) = N_Expanded_Name
or else (Nkind (N) in N_Op and then E = Entity (N))
or else In_Instance
or else (In_Instance or else In_Inlined_Body)
or else Ekind (Vis_Type) = E_Anonymous_Access_Type
then
null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment