summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elab.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_elab.adb')
-rw-r--r--gcc/ada/sem_elab.adb13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index f7236abe20e..3a411f8d8d4 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -1051,8 +1051,17 @@ package body Sem_Elab is
and then In_Preelaborated_Unit
and then not In_Inlined_Body
then
- Error_Msg_N
- ("non-static call not allowed in preelaborated unit", N);
+ -- This is a warning in -gnatg mode allowing such calls to
+ -- be used in the predefined library with appropriate care.
+
+ if GNAT_Mode then
+ Error_Msg_N
+ ("?non-static call not allowed in preelaborated unit", N);
+ else
+ Error_Msg_N
+ ("non-static call not allowed in preelaborated unit", N);
+ end if;
+
return;
end if;