Commit 48b08b18 by Arnaud Charlet

[multiple changes]

2014-01-27  Ben Brosgol  <brosgol@adacore.com>

	* gnat_rm.texi: Minor clarifications.

2014-01-27  Robert Dewar  <dewar@adacore.com>

	* sem_elab.adb (Check_Internal_Call_Continue): Avoid complaining
	about call that is generated as part of an Initial_Condition
	check.
	* sem_prag.adb: Minor spelling correction.

From-SVN: r207136
parent 1b8b4638
2014-01-27 Ben Brosgol <brosgol@adacore.com>
* gnat_rm.texi: Minor clarifications.
2014-01-27 Robert Dewar <dewar@adacore.com>
* sem_elab.adb (Check_Internal_Call_Continue): Avoid complaining
about call that is generated as part of an Initial_Condition
check.
* sem_prag.adb: Minor spelling correction.
2014-01-27 Robert Dewar <dewar@adacore.com> 2014-01-27 Robert Dewar <dewar@adacore.com>
* sem_prag.adb (Set_Convention_From_Pragma): Check that * sem_prag.adb (Set_Convention_From_Pragma): Check that
......
...@@ -26,8 +26,6 @@ included in the section entitled ``GNU Free Documentation License''. ...@@ -26,8 +26,6 @@ included in the section entitled ``GNU Free Documentation License''.
@end copying @end copying
@set EDITION GNAT @set EDITION GNAT
@set DEFAULTLANGUAGEVERSION Ada 2005
@set NONDEFAULTLANGUAGEVERSION Ada 95
@settitle GNAT Reference Manual @settitle GNAT Reference Manual
...@@ -697,15 +695,15 @@ This manual contains useful information in writing programs using the ...@@ -697,15 +695,15 @@ This manual contains useful information in writing programs using the
characteristics of @value{EDITION}, including all the information required by characteristics of @value{EDITION}, including all the information required by
Annex M of the Ada language standard. Annex M of the Ada language standard.
@value{EDITION} implements Ada 95 and Ada 2005, and it may also be invoked in @value{EDITION} implements Ada 95, Ada 2005 and Ada 2012, and it may also be
Ada 83 compatibility mode. invoked in Ada 83 compatibility mode.
By default, @value{EDITION} assumes @value{DEFAULTLANGUAGEVERSION}, By default, @value{EDITION} assumes Ada 2012,
but you can override with a compiler switch but you can override with a compiler switch
to explicitly specify the language version. to explicitly specify the language version.
(Please refer to @ref{Compiling Different Versions of Ada,,, gnat_ugn, (Please refer to @ref{Compiling Different Versions of Ada,,, gnat_ugn,
@value{EDITION} User's Guide}, for details on these switches.) @value{EDITION} User's Guide}, for details on these switches.)
Throughout this manual, references to ``Ada'' without a year suffix 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 all the Ada versions of the language.
Ada is designed to be highly portable. Ada is designed to be highly portable.
In general, a program will have the same effect even when compiled by In general, a program will have the same effect even when compiled by
...@@ -2972,11 +2970,11 @@ You can use this pragma either to access a predefined @code{System} ...@@ -2972,11 +2970,11 @@ You can use this pragma either to access a predefined @code{System}
extension supplied with the compiler, for example @code{Aux_DEC} or extension supplied with the compiler, for example @code{Aux_DEC} or
you can construct your own extension unit following the above you can construct your own extension unit following the above
definition. Note that such a package is a child of @code{System} definition. Note that such a package is a child of @code{System}
and thus is considered part of the implementation. To compile and thus is considered part of the implementation.
it you will have to use the appropriate switch for compiling To compile it you will have to use the @option{-gnatg} switch,
system units. or the @option{/GNAT_INTERNAL} qualifier on OpenVMS,
@xref{Top, @value{EDITION} User's Guide, About This Guide, gnat_ugn, @value{EDITION} User's Guide}, for compiling System units, as explained in the
for details. @value{EDITION} User's Guide.
@node Pragma Extensions_Allowed @node Pragma Extensions_Allowed
@unnumberedsec Pragma Extensions_Allowed @unnumberedsec Pragma Extensions_Allowed
......
...@@ -2155,18 +2155,52 @@ package body Sem_Elab is ...@@ -2155,18 +2155,52 @@ package body Sem_Elab is
declare declare
P : Node_Id; P : Node_Id;
O : Node_Id;
begin begin
P := Parent (N); P := Parent (N);
loop loop
-- Keep looking at parents if we are still in the subexpression
if Nkind (P) in N_Subexpr then if Nkind (P) in N_Subexpr then
P := Parent (P); P := Parent (P);
elsif Nkind (P) = N_If_Statement
and then Nkind (Original_Node (P)) = N_Pragma -- Here P is the parent of the expression, check for special case
and then Present (Corresponding_Aspect (Original_Node (P)))
then
return;
else else
exit; O := Original_Node (P);
-- Definitely not the special case if orig node is not a pragma
exit when Nkind (O) /= N_Pragma;
-- Check we have an If statement or a null statement (happens
-- when the If has been expanded to be True).
exit when not Nkind_In (P, N_If_Statement, N_Null_Statement);
-- Our special case will be indicated either by the pragma
-- coming from an aspect ...
if Present (Corresponding_Aspect (O)) then
return;
-- Or, in the case of an initial condition, specifically by a
-- Check pragma specifying an Initial_Condition check.
elsif Pragma_Name (O) = Name_Check
and then
Chars
(Expression (First (Pragma_Argument_Associations (O)))) =
Name_Initial_Condition
then
return;
-- For anything else, we have an error
else
exit;
end if;
end if; end if;
end loop; end loop;
end; end;
......
...@@ -2358,7 +2358,7 @@ package body Sem_Prag is ...@@ -2358,7 +2358,7 @@ package body Sem_Prag is
end if; end if;
-- The expression is preanalyzed because it has not been moved to its -- The expression is preanalyzed because it has not been moved to its
-- final place yet. A direct analysis may generate sife effects and this -- final place yet. A direct analysis may generate side effects and this
-- is not desired at this point. -- is not desired at this point.
Preanalyze_And_Resolve (Expr, Standard_Boolean); Preanalyze_And_Resolve (Expr, Standard_Boolean);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment