+2019-07-04 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_ch6.adb (Analyze_Subprogram_Body_Helper): The special
+ treatment of calling Mask_Unfrozen_Types must also be done in
+ the case of an Ignored_Ghost_Entity, because Expander_Active is
+ False in that case.
+
2019-07-04 Yannick Moy <moy@adacore.com>
* sem_prag.adb (Check_Library_Level_Entity): Update for new rule
-- generated. Freeze nodes, if any, are inserted before the current
-- body. These freeze actions are also needed in ASIS mode and in
-- Compile_Only mode to enable the proper back-end type annotations.
- -- They are necessary in any case to insure order of elaboration
+ -- They are necessary in any case to ensure proper elaboration order
-- in gigi.
if Nkind (N) = N_Subprogram_Body
and then Serious_Errors_Detected = 0
and then (Expander_Active
or else ASIS_Mode
- or else Operating_Mode = Check_Semantics)
+ or else Operating_Mode = Check_Semantics
+ or else Is_Ignored_Ghost_Entity (Spec_Id))
then
-- The body generated for an expression function that is not a
-- completion is a freeze point neither for the profile nor for
-- anything else. That's why, in order to prevent any freezing
-- during analysis, we need to mask types declared outside the
-- expression (and in an outer scope) that are not yet frozen.
+ -- This also needs to be done in the case of an ignored Ghost
+ -- expression function, where the expander isn't active.
Set_Is_Frozen (Spec_Id);
Mask_Types := Mask_Unfrozen_Types (Spec_Id);
+2019-07-04 Gary Dismukes <dismukes@adacore.com>
+
+ * gnat.dg/ghost5.adb, gnat.dg/ghost5.ads,
+ gnat.dg/ghost5_parent.ads: New testcase.
+
2019-07-04 Yannick Moy <moy@adacore.com>
* gnat.dg/spark3.adb: New testcase.
--- /dev/null
+package Ghost5_Parent is
+
+ type Priv is private;
+
+ package Nested with Ghost is
+ function Func1 (X : Priv) return Boolean is (True); -- Error flagged here
+ function Func2 (X : Priv) return Boolean is (False);
+ end Nested;
+
+private
+
+ type Priv is new Integer;
+
+end Ghost5_Parent;