aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch4.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-11-25 22:02:29 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-12-15 06:41:56 -0500
commit3a6298d639333eb729a2cea441aeaffcff619227 (patch)
tree6d45c402d9401d48866ba77704a95f06f341e14f /gcc/ada/par-ch4.adb
parent04974721aeee72da4dc497d371bad42a779ad89e (diff)
downloadgcc-3a6298d639333eb729a2cea441aeaffcff619227.zip
gcc-3a6298d639333eb729a2cea441aeaffcff619227.tar.gz
gcc-3a6298d639333eb729a2cea441aeaffcff619227.tar.bz2
[Ada] Refactor repeated complains about missing -gnat2005 switch
gcc/ada/ * errout.ads (Error_Msg_Ada_2005_Extension): New routine (spec). * errout.adb (Error_Msg_Ada_2005_Extension): New routine (body). * par-ch10.adb: Reuse new routine; correct casing for "LIMITED WITH". * par-ch11.adb: Likewise. * par-ch12.adb: Likewise. * par-ch3.adb: Likewise. * par-ch4.adb: Likewise; replace "box" with "<>". * par-ch6.adb: Likewise. * par-ch9.adb: Likewise; correct casing for "THEN ABORT".
Diffstat (limited to 'gcc/ada/par-ch4.adb')
-rw-r--r--gcc/ada/par-ch4.adb10
1 files changed, 2 insertions, 8 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index b4eebfe..c1e781c 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -1360,9 +1360,7 @@ package body Ch4 is
procedure Box_Error is
begin
- if Ada_Version < Ada_2005 then
- Error_Msg_SC ("box in aggregate is an Ada 2005 extension");
- end if;
+ Error_Msg_Ada_2005_Extension ("'<'> in aggregate");
-- Ada 2005 (AI-287): The box notation is allowed only with named
-- notation because positional notation might be error prone. For
@@ -1755,11 +1753,7 @@ package body Ch4 is
-- Ada 2005(AI-287): The box notation is used to indicate the
-- default initialization of aggregate components
- if Ada_Version < Ada_2005 then
- Error_Msg_SP
- ("component association with '<'> is an Ada 2005 extension");
- Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
- end if;
+ Error_Msg_Ada_2005_Extension ("component association with '<'>");
Set_Box_Present (Assoc_Node);
Scan; -- Past box