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.
@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
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
-----------------------------
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 :=
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