2019-12-13 Arnaud Charlet <charlet@adacore.com>
gcc/ada/
* exp_unst.adb (Unnest_Subprogram): Account for trees produced
by Annex E constructs.
From-SVN: r279367
+2019-12-13 Arnaud Charlet <charlet@adacore.com>
+
+ * exp_unst.adb (Unnest_Subprogram): Account for trees produced
+ by Annex E constructs.
+
2019-12-13 Ghjuvan Lacambre <lacambre@adacore.com>
* doc/gnat_rm/implementation_defined_pragmas.rst: Update
then
return;
- -- Only unnest when generating code for the main source unit or if we're
- -- unnesting for inline.
+ -- Only unnest when generating code for the main source unit or if
+ -- we're unnesting for inline. But in some Annex E cases the Sloc
+ -- points to a different unit, so also make sure that the Parent
+ -- isn't in something that we know we're generating code for.
elsif not For_Inline
and then not In_Extended_Main_Code_Unit (Subp_Body)
+ and then not In_Extended_Main_Code_Unit (Parent (Subp_Body))
then
return;
end if;