Commit 63bb4268 by Arnaud Charlet

[multiple changes]

2013-10-14  Arnaud Charlet  <charlet@adacore.com>

	* exp_ch11.adb: Fix typo.

2013-10-14  Thomas Quinot  <quinot@adacore.com>

	* exp_util.ads: Minor reformatting.

2013-10-14  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Build_Derived_Record_Type): Reject full views
	with no explicit discriminant constraints, when the parents of
	the partial view and the full view are constrained subtypes with
	different constraints.

2013-10-14  Robert Dewar  <dewar@adacore.com>

	* freeze.adb (Freeze_Array_Type): New procedure, abstracts out
	this code from Freeze.
	(Freeze_Array_Type): Detect pragma Pack overriding foreign convention
	(Freeze_Record_Type): Ditto.

From-SVN: r203553
parent e74d643a
2013-10-14 Arnaud Charlet <charlet@adacore.com>
* exp_ch11.adb: Fix typo.
2013-10-14 Thomas Quinot <quinot@adacore.com>
* exp_util.ads: Minor reformatting.
2013-10-14 Ed Schonberg <schonberg@adacore.com>
* sem_ch3.adb (Build_Derived_Record_Type): Reject full views
with no explicit discriminant constraints, when the parents of
the partial view and the full view are constrained subtypes with
different constraints.
2013-10-14 Robert Dewar <dewar@adacore.com>
* freeze.adb (Freeze_Array_Type): New procedure, abstracts out
this code from Freeze.
(Freeze_Array_Type): Detect pragma Pack overriding foreign convention
(Freeze_Record_Type): Ditto.
2013-10-14 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Dependency_Clause): Add new local variable
......
......@@ -1026,7 +1026,7 @@ package body Exp_Ch11 is
-- end;
-- This expansion is not performed when using GCC ZCX. Gigi
-- will insert a call to intialize the choice parameter.
-- will insert a call to initialize the choice parameter.
if Present (Choice_Parameter (Handler))
and then Exception_Mechanism /= Back_End_Exceptions
......
......@@ -359,9 +359,9 @@ package Exp_Util is
-- by the compiler and used by GDB.
procedure Evaluate_Name (Nam : Node_Id);
-- Remove the all side effects from a name which appears as part of an
-- object renaming declaration. More comments are needed here that explain
-- how this differs from Force_Evaluation and Remove_Side_Effects ???
-- Remove all side effects from a name which appears as part of an object
-- renaming declaration. More comments are needed here that explain how
-- this differs from Force_Evaluation and Remove_Side_Effects ???
procedure Evolve_And_Then (Cond : in out Node_Id; Cond1 : Node_Id);
-- Rewrites Cond with the expression: Cond and then Cond1. If Cond is
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1001,7 +1001,7 @@ package body Sem_Ch3 is
if Nkind (Def) in N_Has_Etype then
if Etype (Def) = T_Name then
Error_Msg_N
("type& cannot be used before end of its declaration", Def);
("typer cannot be used before end of its declaration", Def);
end if;
-- If this is not a subtype, then this is an access_definition
......@@ -7337,19 +7337,37 @@ package body Sem_Ch3 is
and then (Is_Constrained (Parent_Type) or else Constraint_Present)
then
-- First, we must analyze the constraint (see comment in point 5.)
-- The constraint may come from the subtype indication of the full
-- declaration.
if Constraint_Present then
New_Discrs := Build_Discriminant_Constraints (Parent_Type, Indic);
New_Discrs :=
Build_Discriminant_Constraints (Parent_Type, Indic);
-- If there is no explicit constraint, there might be one that is
-- inherited from a constrained parent type. In that case verify that
-- it conforms to the constraint in the partial view. In perverse
-- cases the parent subtypes of the partial and full view can have
-- different constraints.
elsif Present (Stored_Constraint (Parent_Type)) then
New_Discrs := Stored_Constraint (Parent_Type);
else
New_Discrs := No_Elist;
end if;
if Has_Discriminants (Derived_Type)
and then Has_Private_Declaration (Derived_Type)
and then Present (Discriminant_Constraint (Derived_Type))
and then Present (New_Discrs)
then
-- Verify that constraints of the full view statically match
-- those given in the partial view.
declare
C1, C2 : Elmt_Id;
Error_Node : Node_Id;
begin
C1 := First_Elmt (New_Discrs);
......@@ -7366,9 +7384,15 @@ package body Sem_Ch3 is
null;
else
if Constraint_Present then
Error_Msg_N (
"constraint not conformant to previous declaration",
Node (C1));
else
Error_Msg_N (
"constraint of full view is incompatible " &
"with partial view", N);
end if;
end if;
Next_Elmt (C1);
......@@ -7376,7 +7400,6 @@ package body Sem_Ch3 is
end loop;
end;
end if;
end if;
-- Insert and analyze the declaration for the unconstrained base type
......
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