diff options
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r-- | gcc/ada/sem_ch12.adb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb index d04ef46..1fe5277 100644 --- a/gcc/ada/sem_ch12.adb +++ b/gcc/ada/sem_ch12.adb @@ -12402,7 +12402,16 @@ package body Sem_Ch12 is Analyze (Act); end if; - if Errs /= Serious_Errors_Detected then + -- Ensure that a ghost function does not act as generic actual + + if Is_Entity_Name (Act) + and then Is_Ghost_Function (Entity (Act)) + then + Error_Msg_N + ("ghost function & cannot act as generic actual", Act); + Abandon_Instantiation (Act); + + elsif Errs /= Serious_Errors_Detected then -- Do a minimal analysis of the generic, to prevent spurious -- warnings complaining about the generic being unreferenced, |