aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ada/ChangeLog16
-rw-r--r--gcc/ada/exp_ch3.adb4
-rw-r--r--gcc/ada/par-ch5.adb12
-rw-r--r--gcc/ada/scng.adb9
-rw-r--r--gcc/ada/sem_aggr.adb2
-rw-r--r--gcc/ada/sem_ch12.adb3
-rw-r--r--gcc/ada/sem_ch6.adb2
-rw-r--r--gcc/ada/sem_prag.adb14
8 files changed, 45 insertions, 17 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index c1dbf98..d5bb9b1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,21 @@
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
Component_Size): It is now illegal to give an incorrect component size
clause in the case of aliased or atomic components.
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index a304c4b..7a00d39 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -230,7 +230,7 @@ package body Exp_Ch3 is
(Typ : Entity_Id;
Eq_Name : Name_Id) return Node_Id;
-- 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.
function Make_Eq_Case
@@ -6174,7 +6174,7 @@ package body Exp_Ch3 is
-- In the non-tagged case, ever since Ada83 an equality function must
-- 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.
elsif Has_Discriminants (Def_Id)
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index f18197e..04e1005 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -84,7 +84,7 @@ package body Ch5 is
---------------------------------
-- SEQUENCE_OF_STATEMENTS ::= STATEMENT {STATEMENT} {LABEL}
- -- Note: the final label is an Ada2012 addition.
+ -- Note: the final label is an Ada 2012 addition.
-- STATEMENT ::=
-- {LABEL} SIMPLE_STATEMENT | {LABEL} COMPOUND_STATEMENT
@@ -150,12 +150,12 @@ package body Ch5 is
-- is required. It is initialized from the Sreq flag, and modified as
-- statements are scanned (a statement turns it off, and a label turns
-- 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;
- -- In Ada2012 a label can end a sequence of statements, but the sequence
- -- cannot contain only labels. This flag is set whenever a label is
- -- encountered, to enforce this rule at the end of a sequence.
+ -- In Ada 2012, a label can end a sequence of statements, but the
+ -- sequence cannot contain only labels. This flag is set whenever a
+ -- label is encountered, to enforce this rule at the end of a sequence.
Declaration_Found : Boolean := False;
-- This flag is set True if a declaration is encountered, so that the
@@ -773,7 +773,7 @@ package body Ch5 is
Statement_Required := False;
-- 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 =>
if Present (Last (Statement_List))
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index d838445..5599d83 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -2409,6 +2409,12 @@ package body Scng is
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
if Is_Keyword_Name (Token_Name) then
@@ -2464,14 +2470,11 @@ package body Scng is
-- corresponding keyword.
Token_Name := No_Name;
- Accumulate_Token_Checksum;
return;
-- It is an identifier after all
else
- Token := Tok_Identifier;
- Accumulate_Token_Checksum;
Post_Scan;
return;
end if;
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index 6ef11bb..8077491 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -3890,7 +3890,7 @@ package body Sem_Aggr is
elsif No (Typech) then
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
-- designated types match.
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 8168024..d8f3c98 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -9969,8 +9969,9 @@ package body Sem_Ch12 is
-- interface then the generic formal is not unless declared
-- explicitly so. If not declared limited, the actual cannot be
-- limited (see AI05-0087).
+
-- 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.
if Is_Limited_Type (Act_T)
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 35bd101..38d5c2e 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -5864,7 +5864,7 @@ package body Sem_Ch6 is
Obj_Decl, Typ);
Error_Msg_N
("\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;
end if;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 5df154b..e686f43 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -5944,12 +5944,13 @@ package body Sem_Prag is
and then Nkind (Object_Definition (D)) =
N_Constrained_Array_Definition)
then
- Ctyp := Component_Type (E);
-
-- The flag is set on the object, or on the base type
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);
@@ -9918,7 +9919,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;
@@ -9931,6 +9932,13 @@ package body Sem_Prag is
or else Is_Atomic (Component_Type (Typ))
then
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;
-- If we had an explicit component size given, then we do not