public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-313] [Ada] Fix Compile_Time_(Error|Warning) as non-configuration pragmas
@ 2022-05-11 8:56 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-11 8:56 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:046c166f3c3351788fcf6e1a9b235f3c808b1289
commit r13-313-g046c166f3c3351788fcf6e1a9b235f3c808b1289
Author: Piotr Trojanek <trojanek@adacore.com>
Date: Fri Feb 4 00:22:41 2022 +0100
[Ada] Fix Compile_Time_(Error|Warning) as non-configuration pragmas
Uses of Compile_Time_Error and Compile_Time_Warning as configuration
pragmas were detected with a custom check in semantic analysis. Now they
are detected with an existing general check in parser.
gcc/ada/
* sem_prag.adb (Analyze_Pragma): Remove custom check for
Compile_Time_Error and Compile_Time_Warning pragmas.
* snames.ads-tmpl (Compile_Time_Error, Compile_Time_Warning):
Move beyond Last_Configuration_Pragma_Name.
Diff:
---
gcc/ada/sem_prag.adb | 9 ---------
gcc/ada/snames.ads-tmpl | 8 ++++----
2 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 7e13d4933bd..0bee4a179c5 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -14322,15 +14322,6 @@ package body Sem_Prag is
when Pragma_Compile_Time_Error | Pragma_Compile_Time_Warning =>
GNAT_Pragma;
- -- These pragmas rely on the context. In adc files they raise
- -- Constraint_Error. Ban them from use as configuration pragmas
- -- even in cases where such a use could work.
-
- if Is_Configuration_Pragma then
- Error_Pragma
- ("pragma% is not allowed as a configuration pragma");
- end if;
-
Process_Compile_Time_Warning_Or_Error;
-----------------------------
diff --git a/gcc/ada/snames.ads-tmpl b/gcc/ada/snames.ads-tmpl
index 5f7d6b7687b..dc09e0768ed 100644
--- a/gcc/ada/snames.ads-tmpl
+++ b/gcc/ada/snames.ads-tmpl
@@ -414,8 +414,6 @@ package Snames is
Name_Check_Float_Overflow : constant Name_Id := N + $; -- GNAT
Name_Check_Name : constant Name_Id := N + $; -- GNAT
Name_Check_Policy : constant Name_Id := N + $; -- GNAT
- Name_Compile_Time_Error : constant Name_Id := N + $; -- GNAT
- Name_Compile_Time_Warning : constant Name_Id := N + $; -- GNAT
Name_Component_Alignment : constant Name_Id := N + $; -- GNAT
Name_Convention_Identifier : constant Name_Id := N + $; -- GNAT
Name_Debug_Policy : constant Name_Id := N + $; -- GNAT
@@ -508,6 +506,8 @@ package Snames is
Name_Check : constant Name_Id := N + $; -- GNAT
Name_Comment : constant Name_Id := N + $; -- GNAT
Name_Common_Object : constant Name_Id := N + $; -- GNAT
+ Name_Compile_Time_Error : constant Name_Id := N + $; -- GNAT
+ Name_Compile_Time_Warning : constant Name_Id := N + $; -- GNAT
Name_Complete_Representation : constant Name_Id := N + $; -- GNAT
Name_Complex_Representation : constant Name_Id := N + $; -- GNAT
Name_Constant_After_Elaboration : constant Name_Id := N + $; -- GNAT
@@ -1738,8 +1738,6 @@ package Snames is
Pragma_Check_Float_Overflow,
Pragma_Check_Name,
Pragma_Check_Policy,
- Pragma_Compile_Time_Error,
- Pragma_Compile_Time_Warning,
Pragma_Component_Alignment,
Pragma_Convention_Identifier,
Pragma_Debug_Policy,
@@ -1819,6 +1817,8 @@ package Snames is
Pragma_Check,
Pragma_Comment,
Pragma_Common_Object,
+ Pragma_Compile_Time_Error,
+ Pragma_Compile_Time_Warning,
Pragma_Complete_Representation,
Pragma_Complex_Representation,
Pragma_Constant_After_Elaboration,
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-05-11 8:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-11 8:56 [gcc r13-313] [Ada] Fix Compile_Time_(Error|Warning) as non-configuration pragmas Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).