This patch modifies the analysis (which is really expansion) of null
procedures to set the Ghost mode of the spec when the null procedure
acts as a completion. This ensures that all nodes and entities
generated by the expansion are marked as Ghost, and provide a proper
context for references to Ghost entities.
* sem_ch6.adb (Analyze_Null_Procedure): Capture Ghost and
SPARK-related global state at the start of the routine. Set the
Ghost mode of the completed spec if any. Restore the saved
Ghost and SPARK-related global state on exit from the routine.
gcc/testsuite/
* gnat.dg/ghost1.adb, gnat.dg/ghost1.ads: New testcase.