Commit feab3549 by Arnaud Charlet

[multiple changes]

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

	* sem_prag.adb (Analyze_Attribute_Definition_Clause, case
	Component_Size): Complete previous change.

2010-10-07  Vincent Celier  <celier@adacore.com>

	* scng.adb (Scan): Call Accumulate_Token_Checksum for Tok_Identifier,
	even for keywords, to avoid having the checksum to depend on the Ada
	version.

2010-10-07  Gary Dismukes  <dismukes@adacore.com>

	* sem_aggr.adb, sem_ch12.adb, sem_ch6.adb, par-ch5.adb,
	exp_ch3.adb: Minor reformatting.

From-SVN: r165106
parent ffdb3d3b
2010-10-07 Robert Dewar <dewar@adacore.com> 2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Analyze_Attribute_Definition_Clause, case
Component_Size): Complete previous change.
2010-10-07 Vincent Celier <celier@adacore.com>
* scng.adb (Scan): Call Accumulate_Token_Checksum for Tok_Identifier,
even for keywords, to avoid having the checksum to depend on the Ada
version.
2010-10-07 Gary Dismukes <dismukes@adacore.com>
* sem_aggr.adb, sem_ch12.adb, sem_ch6.adb, par-ch5.adb,
exp_ch3.adb: Minor reformatting.
2010-10-07 Robert Dewar <dewar@adacore.com>
* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case * sem_ch13.adb (Analyze_Attribute_Definition_Clause, case
Component_Size): It is now illegal to give an incorrect component size Component_Size): It is now illegal to give an incorrect component size
clause in the case of aliased or atomic components. clause in the case of aliased or atomic components.
......
...@@ -230,7 +230,7 @@ package body Exp_Ch3 is ...@@ -230,7 +230,7 @@ package body Exp_Ch3 is
(Typ : Entity_Id; (Typ : Entity_Id;
Eq_Name : Name_Id) return Node_Id; Eq_Name : Name_Id) return Node_Id;
-- Build the body of a primitive equality operation for a tagged record -- Build the body of a primitive equality operation for a tagged record
-- type, or in Ada2012 for any record type that has components with a -- type, or in Ada 2012 for any record type that has components with a
-- user-defined equality. Factored out of Predefined_Primitive_Bodies. -- user-defined equality. Factored out of Predefined_Primitive_Bodies.
function Make_Eq_Case function Make_Eq_Case
...@@ -6174,7 +6174,7 @@ package body Exp_Ch3 is ...@@ -6174,7 +6174,7 @@ package body Exp_Ch3 is
-- In the non-tagged case, ever since Ada83 an equality function must -- In the non-tagged case, ever since Ada83 an equality function must
-- be provided for variant records that are not unchecked unions. -- be provided for variant records that are not unchecked unions.
-- In Ada2012 the equality function composes, and thus must be built -- In Ada 2012 the equality function composes, and thus must be built
-- explicitly just as for tagged records. -- explicitly just as for tagged records.
elsif Has_Discriminants (Def_Id) elsif Has_Discriminants (Def_Id)
......
...@@ -84,7 +84,7 @@ package body Ch5 is ...@@ -84,7 +84,7 @@ package body Ch5 is
--------------------------------- ---------------------------------
-- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT} {LABEL} -- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT} {LABEL}
-- Note: the final label is an Ada2012 addition. -- Note: the final label is an Ada 2012 addition.
-- STATEMENT ::= -- STATEMENT ::=
-- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT -- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT
...@@ -150,12 +150,12 @@ package body Ch5 is ...@@ -150,12 +150,12 @@ package body Ch5 is
-- is required. It is initialized from the Sreq flag, and modified as -- is required. It is initialized from the Sreq flag, and modified as
-- statements are scanned (a statement turns it off, and a label turns -- statements are scanned (a statement turns it off, and a label turns
-- it back on again since a statement must follow a label). -- it back on again since a statement must follow a label).
-- Note : this final requirement is lifted in Ada2012. -- Note : this final requirement is lifted in Ada 2012.
Statement_Seen : Boolean; Statement_Seen : Boolean;
-- In Ada2012 a label can end a sequence of statements, but the sequence -- In Ada 2012, a label can end a sequence of statements, but the
-- cannot contain only labels. This flag is set whenever a label is -- sequence cannot contain only labels. This flag is set whenever a
-- encountered, to enforce this rule at the end of a sequence. -- label is encountered, to enforce this rule at the end of a sequence.
Declaration_Found : Boolean := False; Declaration_Found : Boolean := False;
-- This flag is set True if a declaration is encountered, so that the -- This flag is set True if a declaration is encountered, so that the
...@@ -773,7 +773,7 @@ package body Ch5 is ...@@ -773,7 +773,7 @@ package body Ch5 is
Statement_Required := False; Statement_Required := False;
-- Label starting with << which must precede real statement -- Label starting with << which must precede real statement
-- Note: in Ada2012, the label may end the sequence. -- Note: in Ada 2012, the label may end the sequence.
when Tok_Less_Less => when Tok_Less_Less =>
if Present (Last (Statement_List)) if Present (Last (Statement_List))
......
...@@ -2409,6 +2409,12 @@ package body Scng is ...@@ -2409,6 +2409,12 @@ package body Scng is
end if; end if;
end if; end if;
-- We will assume it is an identifier, not a keyword, so that the
-- checksum is independent of the Ada version.
Token := Tok_Identifier;
Accumulate_Token_Checksum;
-- Here is where we check if it was a keyword -- Here is where we check if it was a keyword
if Is_Keyword_Name (Token_Name) then if Is_Keyword_Name (Token_Name) then
...@@ -2464,14 +2470,11 @@ package body Scng is ...@@ -2464,14 +2470,11 @@ package body Scng is
-- corresponding keyword. -- corresponding keyword.
Token_Name := No_Name; Token_Name := No_Name;
Accumulate_Token_Checksum;
return; return;
-- It is an identifier after all -- It is an identifier after all
else else
Token := Tok_Identifier;
Accumulate_Token_Checksum;
Post_Scan; Post_Scan;
return; return;
end if; end if;
......
...@@ -3890,7 +3890,7 @@ package body Sem_Aggr is ...@@ -3890,7 +3890,7 @@ package body Sem_Aggr is
elsif No (Typech) then elsif No (Typech) then
Typech := Base_Type (Etype (Component)); Typech := Base_Type (Etype (Component));
-- AI05-0199: In Ada2012, several components of anonymous -- AI05-0199: In Ada 2012, several components of anonymous
-- access types can appear in a choice list, as long as the -- access types can appear in a choice list, as long as the
-- designated types match. -- designated types match.
......
...@@ -9969,8 +9969,9 @@ package body Sem_Ch12 is ...@@ -9969,8 +9969,9 @@ package body Sem_Ch12 is
-- interface then the generic formal is not unless declared -- interface then the generic formal is not unless declared
-- explicitly so. If not declared limited, the actual cannot be -- explicitly so. If not declared limited, the actual cannot be
-- limited (see AI05-0087). -- limited (see AI05-0087).
-- Even though this AI is a binding interpretation, we enable the -- Even though this AI is a binding interpretation, we enable the
-- check only in Ada2012 mode, because this improper construct -- check only in Ada 2012 mode, because this improper construct
-- shows up in user code and in existing B-tests. -- shows up in user code and in existing B-tests.
if Is_Limited_Type (Act_T) if Is_Limited_Type (Act_T)
......
...@@ -5864,7 +5864,7 @@ package body Sem_Ch6 is ...@@ -5864,7 +5864,7 @@ package body Sem_Ch6 is
Obj_Decl, Typ); Obj_Decl, Typ);
Error_Msg_N Error_Msg_N
("\an equality operator cannot be declared after this " ("\an equality operator cannot be declared after this "
& "point ('R'M 4.5.2 (9.8)) (Ada2012))?", Obj_Decl); & "point ('R'M 4.5.2 (9.8)) (Ada 2012))?", Obj_Decl);
exit; exit;
end if; end if;
......
...@@ -5944,12 +5944,13 @@ package body Sem_Prag is ...@@ -5944,12 +5944,13 @@ package body Sem_Prag is
and then Nkind (Object_Definition (D)) = and then Nkind (Object_Definition (D)) =
N_Constrained_Array_Definition) N_Constrained_Array_Definition)
then then
Ctyp := Component_Type (E);
-- The flag is set on the object, or on the base type -- The flag is set on the object, or on the base type
if Nkind (D) /= N_Object_Declaration then if Nkind (D) /= N_Object_Declaration then
E := Base_Type (E); E := Base_Type (E);
Ctyp := Component_Type (E);
else
Ctyp := Component_Type (Base_Type (Etype (E)));
end if; end if;
Set_Has_Volatile_Components (E); Set_Has_Volatile_Components (E);
...@@ -9918,7 +9919,7 @@ package body Sem_Prag is ...@@ -9918,7 +9919,7 @@ package body Sem_Prag is
and then (Esize (Ctyp) = 8 or else and then (Esize (Ctyp) = 8 or else
Esize (Ctyp) = 16 or else Esize (Ctyp) = 16 or else
Esize (Ctyp) = 32 or else Esize (Ctyp) = 32 or else
Esize (Ctyp) = 64) Esize (Ctyp) >= 64)
then then
Ignore := True; Ignore := True;
...@@ -9931,6 +9932,13 @@ package body Sem_Prag is ...@@ -9931,6 +9932,13 @@ package body Sem_Prag is
or else Is_Atomic (Component_Type (Typ)) or else Is_Atomic (Component_Type (Typ))
then then
Error_Pragma ("cannot pack atomic components"); Error_Pragma ("cannot pack atomic components");
-- Warn for cases of packing non-atomic components of atomic
elsif Is_Atomic (Typ) then
Error_Msg_NE
("non-atomic components of type& may not be accessible "
& "by separate tasks?", N, Typ);
end if; end if;
-- If we had an explicit component size given, then we do not -- If we had an explicit component size given, then we do not
......
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