aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-08-07 19:17:52 +1000
committerNathaniel Shead <nathanieloshead@gmail.com>2024-08-08 12:47:29 +1000
commitc0ad382caa38873bb6078edf5314930504bc01f1 (patch)
tree0dbf424554aedbc4b9090f568cf6c2e24d9ff1cc
parentea973bd4929e113ad438c9fc385c68dac88490aa (diff)
downloadgcc-c0ad382caa38873bb6078edf5314930504bc01f1.zip
gcc-c0ad382caa38873bb6078edf5314930504bc01f1.tar.gz
gcc-c0ad382caa38873bb6078edf5314930504bc01f1.tar.bz2
c++/modules: Clarify error message in read_enum_def
This error message reads to me the wrong way around, particularly in the context of other errors. Updated so that the ellipsis connect. gcc/cp/ChangeLog: * module.cc (trees_in::read_enum_def): Clarify error. gcc/testsuite/ChangeLog: * g++.dg/modules/enum-bad-1_b.C: Update error message. Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
-rw-r--r--gcc/cp/module.cc4
-rw-r--r--gcc/testsuite/g++.dg/modules/enum-bad-1_b.C6
2 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 723f089..0f3e1d9 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -12687,9 +12687,9 @@ trees_in::read_enum_def (tree defn, tree maybe_template)
if (known_decl && new_decl)
{
inform (DECL_SOURCE_LOCATION (new_decl),
- "... this enumerator %qD", new_decl);
+ "enumerator %qD does not match ...", new_decl);
inform (DECL_SOURCE_LOCATION (known_decl),
- "enumerator %qD does not match ...", known_decl);
+ "... this enumerator %qD", known_decl);
}
else if (known_decl || new_decl)
{
diff --git a/gcc/testsuite/g++.dg/modules/enum-bad-1_b.C b/gcc/testsuite/g++.dg/modules/enum-bad-1_b.C
index b01cd66..23e17b0 100644
--- a/gcc/testsuite/g++.dg/modules/enum-bad-1_b.C
+++ b/gcc/testsuite/g++.dg/modules/enum-bad-1_b.C
@@ -13,13 +13,13 @@ import "enum-bad-1_a.H";
ONE one;
-// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:5:6: error: definition of 'enum ONE' does not match\n[^\n]*enum-bad-1_b.C:3:6: note: existing definition 'enum ONE'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:5:11: note: ... this enumerator 'A'\n[^\n]*enum-bad-1_b.C:3:11: note: enumerator 'Q' does not match ...\n[^\n]*enum-bad-1_b.C:15:1: note: during load of binding '::ONE'\n} }
+// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:5:6: error: definition of 'enum ONE' does not match\n[^\n]*enum-bad-1_b.C:3:6: note: existing definition 'enum ONE'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:5:11: note: enumerator 'A' does not match ...\n[^\n]*enum-bad-1_b.C:3:11: note: ... this enumerator 'Q'\n[^\n]*enum-bad-1_b.C:15:1: note: during load of binding '::ONE'\n} }
int i = TWO;
-// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:6:6: error: definition of 'enum<unnamed>' does not match\n[^\n]*enum-bad-1_b.C:4:6: note: existing definition 'enum<unnamed>'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:6:12: note: ... this enumerator 'THREE'\n[^\n]*enum-bad-1_b.C:4:12: note: enumerator 'DREI' does not match ...\n[^\n]*enum-bad-1_b.C:18:9: note: during load of binding '::TWO'\n} }
+// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:6:6: error: definition of 'enum<unnamed>' does not match\n[^\n]*enum-bad-1_b.C:4:6: note: existing definition 'enum<unnamed>'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:6:12: note: enumerator 'THREE' does not match ...\n[^\n]*enum-bad-1_b.C:4:12: note: ... this enumerator 'DREI'\n[^\n]*enum-bad-1_b.C:18:9: note: during load of binding '::TWO'\n} }
FOUR four;
-// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:7:6: error: definition of 'enum FOUR' does not match\n[^\n]*enum-bad-1_b.C:5:6: note: existing definition 'enum FOUR'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:7:12: note: ... this enumerator 'B'\n[^\n]*enum-bad-1_b.C:5:12: note: enumerator 'B' does not match ...\n[^\n]*enum-bad-1_b.C:21:1: note: during load of binding '::FOUR'\n} }
+// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:7:6: error: definition of 'enum FOUR' does not match\n[^\n]*enum-bad-1_b.C:5:6: note: existing definition 'enum FOUR'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:7:12: note: enumerator 'B' does not match ...\n[^\n]*enum-bad-1_b.C:5:12: note: ... this enumerator 'B'\n[^\n]*enum-bad-1_b.C:21:1: note: during load of binding '::FOUR'\n} }
FIVE five;
// { dg-regexp {In module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:8:6: error: definition of 'enum FIVE' does not match\n[^\n]*enum-bad-1_b.C:6:6: note: existing definition 'enum FIVE'\nIn module [^\n]*enum-bad-1_a.H, imported at [^\n]*enum-bad-1_b.C:8:\n[^\n]*enum-bad-1_a.H:8:18: note: additional enumerators beginning with 'E'\n[^\n]*enum-bad-1_b.C:24:1: note: during load of binding '::FIVE'\n} }