OSDN Git Service

2010-10-05 Robert Dewar <dewar@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Oct 2010 10:30:15 +0000 (10:30 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Oct 2010 10:30:15 +0000 (10:30 +0000)
* par-ch5.adb (Test_Statement_Required): Allow all pragmas in Ada 2012
mode.

2010-10-05  Pascal Obry  <obry@adacore.com>

* gnat_rm.texi: Fix typo.

2010-10-05  Arnaud Charlet  <charlet@adacore.com>

* gnat_ugn.texi: Add note about identifiers with same name and
-fdump-ada-spec.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164983 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gnat_rm.texi
gcc/ada/gnat_ugn.texi
gcc/ada/par-ch5.adb

index db244c2..679a335 100644 (file)
@@ -1,5 +1,19 @@
 2010-10-05  Robert Dewar  <dewar@adacore.com>
 
 2010-10-05  Robert Dewar  <dewar@adacore.com>
 
+       * par-ch5.adb (Test_Statement_Required): Allow all pragmas in Ada 2012
+       mode.
+
+2010-10-05  Pascal Obry  <obry@adacore.com>
+
+       * gnat_rm.texi: Fix typo.
+
+2010-10-05  Arnaud Charlet  <charlet@adacore.com>
+
+       * gnat_ugn.texi: Add note about identifiers with same name and
+       -fdump-ada-spec.
+
+2010-10-05  Robert Dewar  <dewar@adacore.com>
+
        * sem_ch4.adb: Minor reformatting.
        * a-direct.ads: Minor comment update.
 
        * sem_ch4.adb: Minor reformatting.
        * a-direct.ads: Minor comment update.
 
index 49aa1e5..aca8c04 100644 (file)
@@ -5688,7 +5688,7 @@ and implementation of the @code{Bit} attribute.
 @unnumberedsec Bit_Position
 @findex Bit_Position
 @noindent
 @unnumberedsec Bit_Position
 @findex Bit_Position
 @noindent
-@code{@var{R.C}'Bit}, where @var{R} is a record object and C is one
+@code{@var{R.C}'Bit_Position}, where @var{R} is a record object and C is one
 of the fields of the record type, yields the bit
 offset within the record contains the first bit of
 storage allocated for the object.  The value of this attribute is of the
 of the fields of the record type, yields the bit
 offset within the record contains the first bit of
 storage allocated for the object.  The value of this attribute is of the
index 2166696..03d0976 100644 (file)
@@ -18107,6 +18107,8 @@ constants. Function macros (macros with arguments) are partially translated
 as comments, to be completed manually if needed.
 @item some extensions (e.g. vector types) are not supported
 @item pointers to pointers or complex structures are mapped to System.Address
 as comments, to be completed manually if needed.
 @item some extensions (e.g. vector types) are not supported
 @item pointers to pointers or complex structures are mapped to System.Address
+@item identifiers with identical name (except casing) will generate compilation
+      errors (e.g. @code{shm_get} vs @code{SHM_GET}).
 @end itemize
 
 The code generated is using the Ada 2005 syntax, which makes it
 @end itemize
 
 The code generated is using the Ada 2005 syntax, which makes it
index 30433ef..428dc78 100644 (file)
@@ -190,14 +190,40 @@ package body Ch5 is
       -----------------------------
 
       procedure Test_Statement_Required is
       -----------------------------
 
       procedure Test_Statement_Required is
+         function All_Pragmas return Boolean;
+         --  Return True if statement list is all pragmas
+
+         -----------------
+         -- All_Pragmas --
+         -----------------
+
+         function All_Pragmas return Boolean is
+            S : Node_Id;
+         begin
+            S := First (Statement_List);
+            while Present (S) loop
+               if Nkind (S) /= N_Pragma then
+                  return False;
+               else
+                  Next (S);
+               end if;
+            end loop;
+
+            return True;
+         end All_Pragmas;
+
+      --  Start of processing for Test_Statement_Required
+
       begin
          if Statement_Required then
 
       begin
          if Statement_Required then
 
-            --  Check no statement required after label in Ada 2012
+            --  Check no statement required after label in Ada 2012, and that
+            --  it is OK to have nothing but pragmas in a statement sequence.
 
             if Ada_Version >= Ada_2012
               and then not Is_Empty_List (Statement_List)
 
             if Ada_Version >= Ada_2012
               and then not Is_Empty_List (Statement_List)
-              and then Nkind (Last (Statement_List)) = N_Label
+              and then (Nkind (Last (Statement_List)) = N_Label
+                          or else All_Pragmas)
             then
                declare
                   Null_Stm : constant Node_Id :=
             then
                declare
                   Null_Stm : constant Node_Id :=
@@ -207,6 +233,8 @@ package body Ch5 is
                   Append_To (Statement_List, Null_Stm);
                end;
 
                   Append_To (Statement_List, Null_Stm);
                end;
 
+            --  All pragmas is OK on
+
             --  If not Ada 2012, or not special case above, give error message
 
             else
             --  If not Ada 2012, or not special case above, give error message
 
             else