summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-05 10:30:15 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-05 10:30:15 +0000
commit7892aafd743c092bcbb34274456384f1af246d2f (patch)
tree9190178a47cd0fd3cb4320d67c4362206056744c /gcc
parent98f7db28f6275af79e04065bb2d7c6e21c5ee398 (diff)
downloadgcc-7892aafd743c092bcbb34274456384f1af246d2f.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog14
-rw-r--r--gcc/ada/gnat_rm.texi2
-rw-r--r--gcc/ada/gnat_ugn.texi2
-rw-r--r--gcc/ada/par-ch5.adb32
4 files changed, 47 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index db244c2e037..679a3350ba1 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,19 @@
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.
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 49aa1e5424e..aca8c0420b8 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -5688,7 +5688,7 @@ and implementation of the @code{Bit} attribute.
@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
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 21666968471..03d0976168a 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -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
+@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
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index 30433ef208e..428dc7890aa 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -190,14 +190,40 @@ package body Ch5 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
- -- 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)
- 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 :=
@@ -207,6 +233,8 @@ package body Ch5 is
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