[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Thu, 7 Oct 2010 13:26:02 +0000 (15:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 7 Oct 2010 13:26:02 +0000 (15:26 +0200)
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

gcc/ada/ChangeLog
gcc/ada/exp_ch3.adb
gcc/ada/par-ch5.adb
gcc/ada/scng.adb
gcc/ada/sem_aggr.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_prag.adb

index c1dbf987b7b033d1a5ae87e206d74d564f6ce16f..d5bb9b19adc43981196ca9a2566ddfa4093b7ca8 100644 (file)
@@ -1,3 +1,19 @@
+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
index a304c4b14cd2de464d5c901d35252f08a8d5484d..7a00d39c3c392a5374fa9f83dd30df0e5840b8fb 100644 (file)
@@ -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)
index f18197e0c132b0c7511e9655ec995fa8b73df820..04e1005e593eaf9603840d4c0d2b0fa3b526225c 100644 (file)
@@ -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))
index d838445e9c1ccd54fbd22664d92d26b01610f90a..5599d83604f839df6119bedf1a4b126e5ef3b339 100644 (file)
@@ -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;
index 6ef11bb8504365c0de6d231be81ff7b9e0ca1f3e..80774910f1efd32518a7a2c00631ea757b3efe23 100644 (file)
@@ -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.
 
index 8168024903114a8795fd39efabd764fcbfc136e5..d8f3c98b7ecfc8aa2bfcdced108bdaff3460fba3 100644 (file)
@@ -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)
index 35bd1014ecabba934a7ca0781f49164f9b888381..38d5c2e34ff2bf5866fb162e8fe0dffb205e62a0 100644 (file)
@@ -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;
 
index 5df154bbf83062e55c1b750a46a5fd7d7d4b2679..e686f43dd104d930e49c22f62a6003cc23d3b5a9 100644 (file)
@@ -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