ghost5.adb
84 Bytes
-
[Ada] Expr. func. with private formal rejected in nested Ghost package · 901a52ba
The compiler prematurely freezes a private type that is the type of a formal parameter of an expression function declared within a nested, inactivated Ghost package, resulting is an error complaining that the private type must be fully defined at that point. This is fixed by testing for Ignored_Ghost_Entity in the condition guarding the code that performs Mask_Unfrozen_Types for an expression function without a separate declaration, ensuring that the expression function's profile isn't frozen prematurely. 2019-07-04 Gary Dismukes <dismukes@adacore.com> gcc/ada/ * 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. gcc/testsuite/ * gnat.dg/ghost5.adb, gnat.dg/ghost5.ads, gnat.dg/ghost5_parent.ads: New testcase. From-SVN: r273065
Gary Dismukes committed