aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2021-12-08 23:24:13 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-01-07 16:24:08 +0000
commit57136d60c69d4ac5c189fd7d5150227179cff79e (patch)
treeef412002cf1b8556459bd567c061e95b8f3e6f6c /gcc/ada
parentc8e99971b643c1b0610175bba047cd789c571c74 (diff)
downloadgcc-57136d60c69d4ac5c189fd7d5150227179cff79e.zip
gcc-57136d60c69d4ac5c189fd7d5150227179cff79e.tar.gz
gcc-57136d60c69d4ac5c189fd7d5150227179cff79e.tar.bz2
[Ada] Fix inconsistent quoting in messages about compile-time errors
gcc/ada/ * exp_ch4.adb (Raise_Accessibility_Error): Move exception name to the message string; move << control characters to the end, for consistency. * sem_ch6.adb (Analyze_Function_Return): Likewise. * sem_util.adb (Compile_Time_Constraint_Error): Likewise. * gcc-interface/decl.c (gnat_to_gnu_entity): Remove quotes around Storage_Error. * gcc-interface/trans.c (gnat_to_gnu): Remove quotes around Constraint_Error. gcc/testsuite/ * gnat.dg/aggr26.adb: Update expected error message.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/exp_ch4.adb4
-rw-r--r--gcc/ada/gcc-interface/decl.c2
-rw-r--r--gcc/ada/gcc-interface/trans.c2
-rw-r--r--gcc/ada/sem_ch6.adb2
-rw-r--r--gcc/ada/sem_util.adb17
5 files changed, 13 insertions, 14 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index bf96e64..262e40e 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -11885,8 +11885,8 @@ package body Exp_Ch4 is
Reason => PE_Accessibility_Check_Failed));
Set_Etype (N, Target_Type);
- Error_Msg_N ("<<accessibility check failure", N);
- Error_Msg_NE ("\<<& [", N, Standard_Program_Error);
+ Error_Msg_N ("accessibility check failure<<", N);
+ Error_Msg_N ("\Program_Error [<<", N);
end Raise_Accessibility_Error;
----------------------
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index af6b6bd..8c0703a 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1400,7 +1400,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST
&& !valid_constant_size_p (TYPE_SIZE_UNIT (gnu_alloc_type)))
- post_error ("??`Storage_Error` will be raised at run time!",
+ post_error ("??Storage_Error will be raised at run time!",
gnat_entity);
gnu_expr
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 3d0820f..f767cc6 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -8300,7 +8300,7 @@ gnat_to_gnu (Node_Id gnat_node)
/* If the result is a constant that overflowed, raise Constraint_Error. */
if (TREE_CODE (gnu_result) == INTEGER_CST && TREE_OVERFLOW (gnu_result))
{
- post_error ("??`Constraint_Error` will be raised at run time", gnat_node);
+ post_error ("??Constraint_Error will be raised at run time", gnat_node);
gnu_result
= build1 (NULL_EXPR, gnu_result_type,
build_call_raise (CE_Overflow_Check_Failed, gnat_node,
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index bd1bb50..5bfbca8 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -1684,7 +1684,7 @@ package body Sem_Ch6 is
Error_Msg_Warn := SPARK_Mode /= On;
Error_Msg_N ("cannot return a local value by reference<<", N);
- Error_Msg_NE ("\& [<<", N, Standard_Program_Error);
+ Error_Msg_N ("\Program_Error [<<", N);
end if;
end if;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 2e2ac24..88181ab 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -6707,24 +6707,23 @@ package body Sem_Util is
if Present (Conc_Typ)
and then not Comes_From_Source (Conc_Typ)
then
- Error_Msg_NEL
- ("\& [<<", N, Standard_Constraint_Error, Eloc);
+ Error_Msg ("\& [<<", Eloc, N);
else
if GNATprove_Mode then
- Error_Msg_NEL
- ("\& would have been raised for objects of this "
- & "type", N, Standard_Constraint_Error, Eloc);
+ Error_Msg
+ ("\Constraint_Error would have been raised"
+ & " for objects of this type", Eloc, N);
else
- Error_Msg_NEL
- ("\& will be raised for objects of this type??",
- N, Standard_Constraint_Error, Eloc);
+ Error_Msg
+ ("\Constraint_Error will be raised"
+ & " for objects of this type??", Eloc, N);
end if;
end if;
end;
else
- Error_Msg_NEL ("\& [<<", N, Standard_Constraint_Error, Eloc);
+ Error_Msg ("\Constraint_Error [<<", Eloc, N);
end if;
else