aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnat_rm.texi
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gnat_rm.texi')
-rw-r--r--gcc/ada/gnat_rm.texi81
1 files changed, 42 insertions, 39 deletions
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi
index 81b6a1140bc..2ff9c117680 100644
--- a/gcc/ada/gnat_rm.texi
+++ b/gcc/ada/gnat_rm.texi
@@ -222,6 +222,7 @@ Implementation Defined Attributes
* AST_Entry::
* Bit::
* Bit_Position::
+* Compiler_Version::
* Code_Address::
* Default_Bit_Order::
* Elaborated::
@@ -1502,7 +1503,7 @@ equality operators defined (such operations can be imported or declared
as subprograms as required). Initialization is allowed only by constructor
functions (see pragma @code{CPP_Constructor}). Such types are implicitly
limited if not explicitly declared as limited or derived from a limited
-type, and a warning is issued in that case.
+type, and an error is issued in that case.
Pragma @code{CPP_Class} is intended primarily for automatic generation
using an automatic binding generator tool.
@@ -1542,47 +1543,16 @@ must be of one of the following forms:
@end itemize
@noindent
-where @var{T} is a tagged type to which the pragma @code{CPP_Class} applies.
+where @var{T} is a tagged limited type imported from C++ with pragma
+@code{Import} and @code{Convention} = @code{CPP}.
The first form is the default constructor, used when an object of type
-@var{T} is created on the Ada side with no explicit constructor. Other
-constructors (including the copy constructor, which is simply a special
-case of the second form in which the one and only argument is of type
-@var{T}), can only appear in two contexts:
-
-@itemize @bullet
-@item
-On the right side of an initialization of an object of type @var{T}.
-@item
-In an extension aggregate for an object of a type derived from @var{T}.
-@end itemize
-
-@noindent
-Although the constructor is described as a function that returns a value
-on the Ada side, it is typically a procedure with an extra implicit
-argument (the object being initialized) at the implementation
-level. GNAT issues the appropriate call, whatever it is, to get the
-object properly initialized.
-
-In the case of derived objects, you may use one of two possible forms
-for declaring and creating an object:
-
-@itemize @bullet
-@item @code{New_Object : Derived_T}
-@item @code{New_Object : Derived_T := (@var{constructor-call with} @dots{})}
-@end itemize
-
-@noindent
-In the first case the default constructor is called and extension fields
-if any are initialized according to the default initialization
-expressions in the Ada declaration. In the second case, the given
-constructor is called and the extension aggregate indicates the explicit
-values of the extension fields.
+@var{T} is created on the Ada side with no explicit constructor. The
+second form covers all the non-default constructors of the type. See
+the GNAT users guide for details.
If no constructors are imported, it is impossible to create any objects
-on the Ada side. If no default constructor is imported, only the
-initialization forms using an explicit call to a constructor are
-permitted.
+on the Ada side and the type is implicitly declared abstract.
Pragma @code{CPP_Constructor} is intended primarily for automatic generation
using an automatic binding generator tool.
@@ -2440,7 +2410,8 @@ pragma Implicit_Packing;
@noindent
This is a configuration pragma that requests implicit packing for packed
arrays for which a size clause is given but no explicit pragma Pack or
-specification of Component_Size is present. Consider this example:
+specification of Component_Size is present. It also applies to records
+where no record representation clause is present. Consider this example:
@smallexample @c ada
type R is array (0 .. 7) of Boolean;
@@ -2462,6 +2433,21 @@ specify the exact size that corresponds to the length of the array multiplied
by the size in bits of the component type.
@cindex Array packing
+Similarly, the following example shows the use in the record case
+
+@smallexample @c ada
+type r is record
+ a, b, c, d, e, f, g, h : boolean;
+ chr : character;
+end record;
+for r'size use 16;
+@end smallexample
+
+@noindent
+Without a pragma Pack, each Boolean field requires 8 bits, so the
+minimum size is 72 bits, but with a pragma Pack, 16 bits would be
+sufficient. The use of pragma Implciit_Packing allows this record
+declaration to compile without an explicit pragma Pack.
@node Pragma Import_Exception
@unnumberedsec Pragma Import_Exception
@cindex OpenVMS
@@ -5162,6 +5148,8 @@ A turn off all optional warnings
.A turn off warnings for failing assertions
b turn on warnings for bad fixed value (not multiple of small)
B* turn off warnings for bad fixed value (not multiple of small)
+.b* turn on warnings for biased representation
+.B turn off warnings for biased representation
c turn on warnings for constant conditional
C* turn off warnings for constant conditional
.c turn on warnings for unrepped components
@@ -5169,6 +5157,7 @@ C* turn off warnings for constant conditional
d turn on warnings for implicit dereference
D* turn off warnings for implicit dereference
e treat all warnings as errors
+.e turn on every optional warning
f turn on warnings for unreferenced formal
F* turn off warnings for unreferenced formal
g* turn on warnings for unrecognized pragma
@@ -5192,6 +5181,8 @@ O turn off warnings for address clause overlay
.O* turn off warnings for out parameters assigned but not read
p turn on warnings for ineffective pragma Inline in frontend
P* turn off warnings for ineffective pragma Inline in frontend
+.p turn on warnings for parameter ordering
+.P* turn off warnings for parameter ordering
q* turn on warnings for questionable missing parentheses
Q turn off warnings for questionable missing parentheses
r turn on warnings for redundant construct
@@ -5207,6 +5198,8 @@ v* turn on warnings for unassigned variable
V turn off warnings for unassigned variable
w* turn on warnings for wrong low bound assumption
W turn off warnings for wrong low bound assumption
+.w turn on warnings for unnecessary Warnings Off pragmas
+.W* turn off warnings for unnecessary Warnings Off pragmas
x* turn on warnings for export/import
X turn off warnings for export/import
.x turn on warnings for non-local exceptions
@@ -5360,6 +5353,7 @@ consideration, you should minimize the use of these attributes.
* AST_Entry::
* Bit::
* Bit_Position::
+* Compiler_Version::
* Code_Address::
* Default_Bit_Order::
* Elaborated::
@@ -5512,6 +5506,15 @@ type @code{Universal_Integer}. The value depends only on the field
@var{C} and is independent of the alignment of
the containing record @var{R}.
+@node Compiler_Version
+@unnumberedsec Compiler_Version
+@findex Compiler_Version
+@noindent
+@code{Standard'Compiler_Version} (@code{Standard} is the only allowed
+prefix) yields a static string identifying the version of the compiler
+being used to compile the unit containing the attribute reference. A
+typical result would be something like "GNAT Pro 6.3.0w (20090221)".
+
@node Code_Address
@unnumberedsec Code_Address
@findex Code_Address