+2015-10-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch11.adb (Analyze_Handled_Statements): If the scope is a
+ postcondition subprogram, do not check for useless assignments
+ because there are no source references in such a body, and the
+ call will lose deferred references from the enclosing subprogram.
+
+2015-10-20 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb: nalyze_Attribute_Definition_Clause, case
+ 'Address): If either object is controlled the overlay is
+ erroneous, but analysis must be completed so that back-end sees
+ address clause and completes code generation. Improve text
+ of warning.
+
+2015-10-20 Thomas Quinot <quinot@adacore.com>
+
+ * exp_ch4.adb: Minor reformatting.
+
2015-10-20 Bob Duff <duff@adacore.com>
* s-mudido-affinity.adb (Create): Correct subranges of slices of CPU
if RTE_Available (Comp) then
-- Expand to a call only if the runtime function is available,
- -- otherwise fallback to inline code.
+ -- otherwise fall back to inline code.
Remove_Side_Effects (Op1, Name_Req => True);
Remove_Side_Effects (Op2, Name_Req => True);
with Sem_Util; use Sem_Util;
with Sem_Warn; use Sem_Warn;
with Sinfo; use Sinfo;
+with Snames; use Snames;
with Stand; use Stand;
package body Sem_Ch11 is
-- If the current scope is a subprogram, then this is the right place to
-- check for hanging useless assignments from the statement sequence of
- -- the subprogram body.
+ -- the subprogram body. Skip this in the body of a postcondition,
+ -- since in that case there are no source references, and we need to
+ -- preserve deferred references from the enclosing scope.
- if Is_Subprogram (Current_Scope) then
+ if Is_Subprogram (Current_Scope)
+ and then Chars (Current_Scope) /= Name_uPostconditions
+ then
Warn_On_Useless_Assignments (Current_Scope);
end if;
Find_Overlaid_Entity (N, O_Ent, Off);
- -- Overlaying controlled objects is erroneous
+ -- Overlaying controlled objects is erroneous.
+ -- Emit warning but continue analysis because program is
+ -- itself legal, and back-end must see address clause.
if Present (O_Ent)
and then (Has_Controlled_Component (Etype (O_Ent))
or else Is_Controlled (Etype (O_Ent)))
+ and then not Inside_A_Generic
then
Error_Msg_N
- ("??cannot overlay with controlled object", Expr);
+ ("??cannot use overlays with controlled objects", Expr);
Error_Msg_N
("\??Program_Error will be raised at run time", Expr);
Insert_Action (Declaration_Node (U_Ent),
Make_Raise_Program_Error (Loc,
Reason => PE_Overlaid_Controlled_Object));
- return;
elsif Present (O_Ent)
and then Ekind (U_Ent) = E_Constant