else
-- A special case, if we have a string subtype with bounds 1 .. N,
-- where N is known at compile time, and the aggregate is of the
- -- form (others => 'x'), and N is less than 80 (an arbitrary limit
- -- for now), then replace the aggregate by the equivalent string
- -- literal (but do not mark it as static since it is not!)
+ -- form (others => 'x'), with a single choice and no expressions,
+ -- and N is less than 80 (an arbitrary limit for now), then replace
+ -- the aggregate by the equivalent string literal (but do not mark
+ -- it as static since it is not!)
-- Note: this entire circuit is redundant with respect to code in
-- Expand_Array_Aggregate that collapses others choices to positional
begin
if Nkind (First (Choices (CA))) = N_Others_Choice
and then Nkind (Expression (CA)) = N_Character_Literal
+ and then No (Expressions (N))
then
declare
T : constant Entity_Id := Etype (N);
@set FSFEDITION
@set EDITION GNAT
-@set DEFAULTLANGUAGEVERSION Ada 2005
-@set NONDEFAULTLANGUAGEVERSION Ada 95
@ifset unw
@set PLATFORM
It documents the features of the compiler and tools, and explains
how to use them to build Ada applications.
-@value{EDITION} implements Ada 95 and Ada 2005, and it may also be invoked in
-Ada 83 compatibility mode.
-By default, @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
-but you can override with a compiler switch
-(@pxref{Compiling Different Versions of Ada})
+@value{EDITION} implements Ada 95, Ada 2005 and Ada 2012, and it may also be
+invoked in Ada 83 compatibility mode.
+By default, @value{EDITION} assumes Ada 2012, but you can override with a
+compiler switch (@pxref{Compiling Different Versions of Ada})
to explicitly specify the language version.
Throughout this manual, references to ``Ada'' without a year suffix
-apply to both the Ada 95 and Ada 2005 versions of the language.
-
+apply to both all Ada 95/2005/2012 versions of the language.
@ifclear FSFEDITION
For ease of exposition, ``@value{EDITION}'' will be referred to simply as
@end ifclear
-
-
@menu
* What This Guide Contains::
* What You Should Know before Reading This Guide::
@noindent
The switches described in this section allow you to explicitly specify
the version of the Ada language that your programs are written in.
-By default @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION},
-but you can also specify @value{NONDEFAULTLANGUAGEVERSION} or
+The default mode is Ada 2012,
+but you can also specify Ada 95, Ada 2005 mode, or
indicate Ada 83 compatibility mode.
@table @option
@option{-gnat83} and @option{-gnat95} switches for further
information).
-@ifset PROEDITION
-Note that even though Ada 2005 is the current official version of the
-language, GNAT still compiles in Ada 95 mode by default, so if you are
-using Ada 2005 features in your program, you must use this switch (or
-the equivalent Ada_05 or Ada_2005 configuration pragmas).
-@end ifset
-
@item -gnat12 or -gnat2012 (Ada 2012 mode)
@cindex @option{-gnat12} (@command{gcc})
@cindex @option{-gnat2012} (@command{gcc})
@noindent
This switch directs the compiler to implement the Ada 2012 version of the
-language.
+language (also the default).
Since Ada 2012 is almost completely upwards
compatible with Ada 2005 (and thus also with Ada 83, and Ada 95),
Ada 83 and Ada 95 programs
@option{-gnat83}, @option{-gnat95}, and @option{-gnat05/2005} switches
for further information).
-For information about the approved ``Ada Issues'' that have been incorporated
-into Ada 2012, see @url{http://www.ada-auth.org/ais.html}.
-Included with GNAT releases is a file @file{features-ada12} that describes
-the set of implemented Ada 2012 features.
-
@item -gnatX (Enable GNAT Extensions)
@cindex @option{-gnatX} (@command{gcc})
@cindex Ada language extensions
begin
Note_Possible_Modification (AV, Sure => True);
- -- We must reject parenthesized variable names. The check for
- -- Comes_From_Source is present because there are currently
- -- cases where the compiler violates this rule (e.g. passing
- -- a task object to its controlled Initialize routine).
+ -- We must reject parenthesized variable names. Comes_From_Source is
+ -- checked because there are currently cases where the compiler violates
+ -- this rule (e.g. passing a task object to its controlled Initialize
+ -- routine). This should be properly documented in sinfo???
if Paren_Count (AV) > 0 and then Comes_From_Source (AV) then
return False;
-- Unchecked conversions are allowed only if they come from the
-- generated code, which sometimes uses unchecked conversions for out
-- parameters in cases where code generation is unaffected. We tell
- -- source unchecked conversions by seeing if they are rewrites of an
- -- original Unchecked_Conversion function call, or of an explicit
+ -- source unchecked conversions by seeing if they are rewrites of
+ -- an original Unchecked_Conversion function call, or of an explicit
-- conversion of a function call or an aggregate (as may happen in the
-- expansion of a packed array aggregate).
elsif Nkind (AV) = N_Unchecked_Type_Conversion then
- if Nkind_In (Original_Node (AV),
- N_Function_Call, N_Aggregate)
- then
+ if Nkind_In (Original_Node (AV), N_Function_Call, N_Aggregate) then
return False;
elsif Comes_From_Source (AV)