aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch11.adb
diff options
context:
space:
mode:
authorGary Dismukes <dismukes@adacore.com>2022-04-05 20:20:10 -0400
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-18 08:41:06 +0000
commit72de114c23027f1d1f0df4c78e69c4302e39e058 (patch)
treec5c1ffd439a5e669ba8b3f8b1ec1f54d3618e501 /gcc/ada/par-ch11.adb
parentb271095d5076f837391b2726c1265ae2e91fafa8 (diff)
downloadgcc-72de114c23027f1d1f0df4c78e69c4302e39e058.zip
gcc-72de114c23027f1d1f0df4c78e69c4302e39e058.tar.gz
gcc-72de114c23027f1d1f0df4c78e69c4302e39e058.tar.bz2
[Ada] Improve error messages for occurrence of GNAT extensions without -gnatX
The error message issued for use of GNAT extension features without specifying -gnatX (or pragma Extensions_Allowed) was confusing in the presence of a pragma specifying a language version (such as "pragma Ada_2022;"), because the pragma supersedes the switch. The message is improved by testing for use of such a pragma, plus use of pragma Extensions_Allowed is now suggested, and several cases are changed to call the common error procedure for flagging uses of extension features. gcc/ada/ * errout.ads (Error_Msg_GNAT_Extension): Add formal Loc and revise comment. * errout.adb (Error_Msg_GNAT_Extension): Condition message on the flag Ada_Version_Pragma, and add suggestion to use of pragma Extensions_Allowed in messages. * par-ch3.adb, par-ch5.adb, par-ch6.adb, par-ch11.adb, par-ch12.adb: Add actual Token_Ptr on calls to Error_Msg_GNAT_Extension. * par-ch4.adb: Change Error_Msg to Error_Msg_GNAT_Extension for error calls related to use of extension features. * sem_ch13.adb: Likewise.
Diffstat (limited to 'gcc/ada/par-ch11.adb')
-rw-r--r--gcc/ada/par-ch11.adb2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/par-ch11.adb b/gcc/ada/par-ch11.adb
index cc10ba7..158050a 100644
--- a/gcc/ada/par-ch11.adb
+++ b/gcc/ada/par-ch11.adb
@@ -234,7 +234,7 @@ package body Ch11 is
end if;
if Token = Tok_When then
- Error_Msg_GNAT_Extension ("raise when statement");
+ Error_Msg_GNAT_Extension ("raise when statement", Token_Ptr);
Mutate_Nkind (Raise_Node, N_Raise_When_Statement);