Commit 518ade91 by Arnaud Charlet

[multiple changes]

2010-10-07  Robert Dewar  <dewar@adacore.com>

	* sem_prag.adb, sem_ch13.adb: Implement AI05-0012-1/02.
	* gcc-interface/Make-lang.in: Update dependencies.

2010-10-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch12.ad: (Instantiate_Object): For an in-out formal of a child
	unit, if the type of the formal is declared in a parent unit and is not
	a formal itself, the actual must be located from an enclosing parent
	instance by normal visibility.

2010-10-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch4.adb (Analyze_Allocator): In Ada 2012, a null_exclusion
	indicator is illegal for an uninitialized allocator.

From-SVN: r165110
parent 4e4edb3b
2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_prag.adb, sem_ch13.adb: Implement AI05-0012-1/02.
* gcc-interface/Make-lang.in: Update dependencies.
2010-10-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.ad: (Instantiate_Object): For an in-out formal of a child
unit, if the type of the formal is declared in a parent unit and is not
a formal itself, the actual must be located from an enclosing parent
instance by normal visibility.
2010-10-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_Allocator): In Ada 2012, a null_exclusion
indicator is illegal for an uninitialized allocator.
2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Analyze_Attribute_Definition_Clause, case
Component_Size): Complete previous change.
......
......@@ -8329,6 +8329,25 @@ package body Sem_Ch12 is
Ftyp :=
Get_Instance_Of (Etype (Defining_Identifier (Analyzed_Formal)));
-- If the type of the formal is not itself a formal, and the
-- current unit is a child unit, the formal type must be declared
-- in a parent, and must be retrieved by visibility.
if Ftyp = Orig_Ftyp
and then Is_Generic_Unit (Scope (Ftyp))
and then
Is_Child_Unit (Scope (Defining_Identifier (Analyzed_Formal)))
then
declare
Temp : constant Node_Id :=
New_Copy_Tree (Subtype_Mark (Analyzed_Formal));
begin
Set_Entity (Temp, Empty);
Find_Type (Temp);
Ftyp := Entity (Temp);
end;
end if;
if Is_Private_Type (Ftyp)
and then not Is_Private_Type (Etype (Actual))
and then (Base_Type (Full_View (Ftyp)) = Base_Type (Etype (Actual))
......
......@@ -1355,13 +1355,24 @@ package body Sem_Ch13 is
then
Ignore := True;
-- Cannot give component size for aliased/atomic types
-- Cannot give component size for aliased/atomic components
elsif Has_Aliased_Components (Btype) then
elsif Has_Aliased_Components (Btype)
or else Is_Aliased (Ctyp)
then
Complain_CS ("aliased");
elsif Has_Atomic_Components (Btype) then
elsif Has_Atomic_Components (Btype)
or else Is_Atomic (Ctyp)
then
Complain_CS ("atomic");
-- Warn for case of atomic type
elsif Is_Atomic (Btype) then
Error_Msg_NE
("non-atomic components of type& may not be accessible "
& "by separate tasks?", N, Btype);
end if;
-- For the biased case, build a declaration for a subtype
......
......@@ -507,13 +507,21 @@ package body Sem_Ch4 is
-- be a null object, and we can insert an unconditional raise
-- before the allocator.
-- Ada2012 (AI-104) : a not null indication here is altogether
-- illegal.
if Can_Never_Be_Null (Type_Id) then
declare
Not_Null_Check : constant Node_Id :=
Make_Raise_Constraint_Error (Sloc (E),
Reason => CE_Null_Not_Allowed);
begin
if Expander_Active then
if Ada_Version >= Ada_12 then
Error_Msg_N
("an uninitialized allocator cannot have"
& " a null exclusion", N);
elsif Expander_Active then
Insert_Action (N, Not_Null_Check);
Analyze (Not_Null_Check);
else
......
......@@ -5948,9 +5948,6 @@ package body Sem_Prag is
if Nkind (D) /= N_Object_Declaration then
E := Base_Type (E);
Ctyp := Component_Type (E);
else
Ctyp := Component_Type (Base_Type (Etype (E)));
end if;
Set_Has_Volatile_Components (E);
......@@ -5961,6 +5958,12 @@ package body Sem_Prag is
if Is_Packed (E) then
Set_Is_Packed (E, False);
if Is_Array_Type (E) then
Ctyp := Component_Type (E);
else
Ctyp := Component_Type (Etype (E));
end if;
if not (Known_Static_Esize (Ctyp)
and then Known_Static_RM_Size (Ctyp)
and then Esize (Ctyp) = RM_Size (Ctyp))
......@@ -9919,7 +9922,7 @@ package body Sem_Prag is
and then (Esize (Ctyp) = 8 or else
Esize (Ctyp) = 16 or else
Esize (Ctyp) = 32 or else
Esize (Ctyp) >= 64)
Esize (Ctyp) = 64)
then
Ignore := True;
......
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