+2014-02-19 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_prag.adb (Check_Arg_Is_Local_Name): For an aspect that
+ applies to a subprogram body, the name is the current scope,
+ rather than being declared in the current scope.
+ (Analyze_Pragma, case No_Return): Handle properly a No_Return
+ aspect applied to a subprogram body.
+
+2014-02-19 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch13.adb (Resolve_Iterable_Operation): Improve resolution
+ of overloaded subprograms, and fix bug in handling of primitive
+ operation Element.
+
+2014-02-19 Pascal Obry <obry@adacore.com>
+
+ * s-os_lib.adb: Minor reformatting.
+
+2014-02-19 Yannick Moy <moy@adacore.com>
+
+ * expander.adb (Expand): Do nothing inside generics.
+ * sem_aggr.adb (Aggregate_Constraint_Checks): Do nothing inside
+ generics.
+
+2014-02-19 Yannick Moy <moy@adacore.com>
+
+ * exp_ch2.adb: Remove useless 'with' of unit Uintp.
+
2014-02-19 Robert Dewar <dewar@adacore.com>
* sem_ch3.adb, style.adb, sem_prag.adb, sem_ch13.adb: Minor reformatting
with Sinput; use Sinput;
with Snames; use Snames;
with Tbuild; use Tbuild;
-with Uintp; use Uintp;
package body Exp_Ch2 is
-- analysis, in which case Full_Analysis = True or a pre-analysis in
-- which case Full_Analysis = False. See the spec of Sem for more info
-- on this. Additionally, the GNATprove_Mode flag indicates that a light
- -- expansion for formal verification should be used.
+ -- expansion for formal verification should be used. This expansion is
+ -- never done inside generics.
-- The second reason for the Expander_Active flag to be False is that
-- we are performing a pre-analysis. During pre-analysis all expansion
-- given that the expansion actions that would normally process it will
-- not take place. This prevents cascaded errors due to stack mismatch.
- if not (Expander_Active or (Full_Analysis and GNATprove_Mode)) then
+ if not Expander_Active
+ and (Inside_A_Generic or not Full_Analysis or not GNATprove_Mode)
+ then
Set_Analyzed (N, Full_Analysis);
if Serious_Errors_Detected > 0 and then Scope_Is_Transient then
end loop;
if Blocking then
- Pid := Invalid_Pid;
- Result := Portable_Spawn (Arg_List'Address);
+ Pid := Invalid_Pid;
+ Result := Portable_Spawn (Arg_List'Address);
else
- Pid := Portable_No_Block_Spawn (Arg_List'Address);
- Result := Boolean'Pos (Pid /= Invalid_Pid);
+ Pid := Portable_No_Block_Spawn (Arg_List'Address);
+ Result := Boolean'Pos (Pid /= Invalid_Pid);
end if;
end Spawn;
-- added in the tree, so that the formal verification can rely on those
-- to be present.
- if not (Expander_Active or GNATprove_Mode) or In_Spec_Expression then
+ if not Expander_Active
+ and (Inside_A_Generic or not Full_Analysis or not GNATprove_Mode)
+ then
return;
end if;
end if;
elsif Nam = Name_Element then
+ F2 := Next_Formal (F1);
+
+ if No (F2)
+ or else Etype (F2) /= Cursor
+ or else Present (Next_Formal (F2))
+ then
+ Error_Msg_N ("no match for Element iterable primitive", N);
+ end if;
null;
else
Get_First_Interp (N, I, It);
while Present (It.Typ) loop
if Ekind (It.Nam) = E_Function
+ and then Scope (It.Nam) = Scope (Typ)
and then Etype (First_Formal (It.Nam)) = Typ
then
F1 := First_Formal (It.Nam);
end if;
elsif Nam = Name_Element then
+ F2 := Next_Formal (F1);
+
if Present (F2)
and then No (Next_Formal (F2))
and then Etype (F2) = Cursor
Generic_Formal_Declarations
(Unit_Declaration_Node (Scop));
+ -- If this is an aspect applied to a subprogram body, the
+ -- pragma is inserted in its declarative part.
+
+ elsif From_Aspect_Specification (N)
+ and then
+ Nkind (Unit_Declaration_Node (Ent)) = N_Subprogram_Body
+ and then Ent = Current_Scope
+ then
+ OK := True;
+
-- Default case, just check that the pragma occurs in the scope
-- of the entity denoted by the name.
E := Homonym (E);
end loop;
+ -- If entity in not in current scope it may be the enclosing
+ -- suprogram body to which the aspect applies.
+
if not Found then
- Error_Pragma_Arg ("no procedure & found for pragma%", Arg);
+ if Entity (Id) = Current_Scope
+ and then From_Aspect_Specification (N)
+ then
+ Set_No_Return (Entity (Id));
+ else
+ Error_Pragma_Arg ("no procedure& found for pragma%", Arg);
+ end if;
end if;
Next (Arg);