+2014-08-01 Vincent Celier <celier@adacore.com>
+
+ * debug.adb: Minor documentation addition for -dn switch.
+
+2014-08-01 Robert Dewar <dewar@adacore.com>
+
+ * sem_aggr.adb, exp_ch9.adb, sem_prag.adb, sem_util.adb,
+ sem_attr.adb, sem_eval.ads, sem_cat.adb, sem_ch13.adb: Improve
+ documentation of Is_Static_Expression vs Is_OK_Static_Expression.
+ In several places, use the Is_OK version as suggested by the spec.
+
+2014-08-01 Vincent Celier <celier@adacore.com>
+
+ * gnatcmd.adb: Revert last change which was not correct.
+
+2014-08-01 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * freeze.adb (Find_Constant): Ensure that the constant being
+ inspected is still an object declaration (i.e. not a renaming).
+
2014-08-01 Ed Schonberg <schonberg@adacore.com>
* sem_ch5.adb (Analyze_Loop_Parameter_Specification): a)
-- dm Issue a message indicating the maximum number of simultaneous
-- compilations.
- -- Equivalent to --keep-temp-files.
-- dn Do not delete temporary files created by gnatmake at the end
-- of execution, such as temporary config pragma files, mapping
- -- files or project path files.
+ -- files or project path files. This debug switch is equivalent to
+ -- the standard switch --keep-temp-files. We retain the debug switch
+ -- for back compatibility with past usage.
-- dp Prints the Q used by routine Make.Compile_Sources every time
-- we go around the main compile loop of Make.Compile_Sources
- -- Equivalent to --keep-temp-files.
-- dq Prints source files as they are enqueued and dequeued in the Q
-- used by routine Make.Compile_Sources. Useful to figure out the
-- dn Do not delete temporary files created by gprbuild at the end
-- of execution, such as temporary config pragma files, mapping
- -- files or project path files.
+ -- files or project path files. This debug switch is equivalent to
+ -- the standard switch --keep-temp-files. We retain the debug switch
+ -- for back compatibility with past usage.
-- dt When a time stamp mismatch has been found for an ALI file,
-- display the source file name, the time stamp expected and
function Non_Static_Bound (Bound : Node_Id) return Boolean is
begin
- if Is_Static_Expression (Bound) then
+ if Is_OK_Static_Expression (Bound) then
return False;
elsif Is_Entity_Name (Bound)
function Find_Constant (Nod : Node_Id) return Traverse_Result is
begin
+ -- When a constant is initialized with the result of a dispatching
+ -- call, the constant declaration is rewritten as a renaming of the
+ -- displaced function result. This scenario is not a premature use of
+ -- a constant even though the Has_Completion flag is not set.
+
if Is_Entity_Name (Nod)
and then Present (Entity (Nod))
and then Ekind (Entity (Nod)) = E_Constant
+ and then Scope (Entity (Nod)) = Current_Scope
+ and then Nkind (Declaration_Node (Entity (Nod))) =
+ N_Object_Declaration
and then not Is_Imported (Entity (Nod))
and then not Has_Completion (Entity (Nod))
- and then Scope (Entity (Nod)) = Current_Scope
then
Error_Msg_NE
("premature use of& in call or instance", N, Entity (Nod));
with Stringt;
with Switch; use Switch;
with Table;
+with Targparm; use Targparm;
with Tempdir;
with Types; use Types;
with GNAT.OS_Lib; use GNAT.OS_Lib;
procedure GNATCmd is
-
- AAMP_On_Target : Boolean := False;
-
Normal_Exit : exception;
-- Raise this exception for normal program termination
-- No usage for Sync
if C /= Sync then
- if AAMP_On_Target then
+ if Targparm.AAMP_On_Target then
Put ("gnaampcmd ");
else
Put ("gnat ");
-- to handle the mapping of GNAAMP tool names. We don't extract it from
-- system.ads, as there may be no default runtime.
- AAMP_On_Target := To_Lower (Command_Name) = "gnaampcmd";
+ Find_Program_Name;
+ AAMP_On_Target := Name_Buffer (1 .. Name_Len) = "gnaampcmd";
-- Put the command line in environment variable GNAT_DRIVER_COMMAND_LINE,
-- so that the spawned tool may know the way the GNAT driver was invoked.
("subtype& has dynamic predicate, not allowed "
& "in aggregate choice", Choice, E);
- elsif not Is_Static_Subtype (E) then
+ elsif not Is_OK_Static_Subtype (E) then
Error_Msg_NE
("non-static subtype& has predicate, not allowed "
& "in aggregate choice", Choice, E);
-- Is_Static_Expression
-- This flag is set on any expression that is static according to the
- -- rules in (RM 4.9(3-32)).
+ -- rules in (RM 4.9(3-32)). This flag should be tested during testing
+ -- of legality of parts of a larger static expression. For all other
+ -- contexts that require static expressions, use the separate predicate
+ -- Is_OK_Static_Expression, since an expression that meets the RM 4.9
+ -- requirements, but raises a constraint error when evaluated in a non-
+ -- static context does not meet the legality requirements.
-- Raises_Constraint_Error
Preanalyze_Spec_Expression (Arg, RTE (RE_Any_Priority));
- if not Is_Static_Expression (Arg) then
+ if not Is_OK_Static_Expression (Arg) then
Check_Restriction (Static_Priorities, Arg);
end if;
if Nkind (Parent (N)) = N_Loop_Parameter_Specification
and then not Has_Dynamic_Predicate_Aspect (Typ)
- and then Is_Static_Subtype (Typ)
+ and then Is_OK_Static_Subtype (Typ)
then
return;
end if;