aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem_prag.adb11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 854cadd..03c0e46 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2018-10-09 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Rewrite
+ pragmas as null statements in GNATprove mode.
+
2018-10-09 Eric Botcazou <ebotcazou@adacore.com>
* exp_ch6.adb (Add_Call_By_Copy_Code): Initialize the temporary
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 7a71f53..2293f73 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -7570,6 +7570,17 @@ package body Sem_Prag is
-- Start of processing for Process_Compile_Time_Warning_Or_Error
begin
+ -- In GNATprove mode, pragmas Compile_Time_Error and
+ -- Compile_Time_Warning are ignored, as the analyzer may not have the
+ -- same information as the compiler (in particular regarding size of
+ -- objects decided in gigi) so it makes no sense to issue an error or
+ -- warning in GNATprove.
+
+ if GNATprove_Mode then
+ Rewrite (N, Make_Null_Statement (Loc));
+ return;
+ end if;
+
Check_Arg_Count (2);
Check_No_Identifiers;
Check_Arg_Is_OK_Static_Expression (Arg2, Standard_String);