+2019-12-16 Yannick Moy <moy@adacore.com>
+
+ * exp_ch6.adb: Fix comment.
+ * sem_res.adb (Resolve_Call): Do not check No_Recursion
+ restriction or indirectly No_Secondary_Stack restriction, when
+ inside an ignored ghost subprogram.
+
2019-12-16 Arnaud Charlet <charlet@adacore.com>
* impunit.adb: Add a-nbnbin, a-nbnbre, a-nubinu to Ada 2020
elsif Is_Thunk (Current_Scope) and then Is_Incomplete_Type (Exptyp) then
return;
- -- A return statement from a Ghost function does not use the secondary
- -- stack (or any other one).
+ -- A return statement from an ignored Ghost function does not use the
+ -- secondary stack (or any other one).
elsif not Requires_Transient_Scope (R_Type)
or else Is_Ignored_Ghost_Entity (Scope_Id)
-- checkable, the case of calling an immediately containing
-- subprogram is easy to catch.
- Check_Restriction (No_Recursion, N);
+ if not Is_Ignored_Ghost_Entity (Nam) then
+ Check_Restriction (No_Recursion, N);
+ end if;
-- If the recursive call is to a parameterless subprogram,
-- then even if we can't statically detect infinite
then
null;
+ -- A return statement from an ignored Ghost function does not use the
+ -- secondary stack (or any other one).
+
elsif Expander_Active
and then Ekind_In (Nam, E_Function, E_Subprogram_Type)
and then Requires_Transient_Scope (Etype (Nam))
+ and then not Is_Ignored_Ghost_Entity (Nam)
then
Establish_Transient_Scope (N, Manage_Sec_Stack => True);