aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-05-08 08:43:16 -0700
committerNathan Sidwell <nathan@acm.org>2020-05-08 08:47:13 -0700
commitdebfaee5d51e3c07bb88a971618de2baff35d9c0 (patch)
tree2235ab59ddd814c6f88ce14e1d6e112636fc1a6d
parente34495985e49545c468e664ee10bd0e66c7395bf (diff)
downloadgcc-debfaee5d51e3c07bb88a971618de2baff35d9c0.zip
gcc-debfaee5d51e3c07bb88a971618de2baff35d9c0.tar.gz
gcc-debfaee5d51e3c07bb88a971618de2baff35d9c0.tar.bz2
EOF has a location
There's no need to special-case EOF's location. For the complete file we give it a legitimate location. And for deferred parses we now zap a temporary EOF onto the next token, so we can just use its location anyway. gcc/cp/ * parser.c (cp_lexer_set_source_position_from_token): EOF has a location too. gcc/testsuite/ * c-c++-common/raw-string-6.c: Adjust EOF error location. * g++.dg/cpp0x/decltype63.C: Likewise. * g++.dg/cpp0x/gen-attrs-64.C: Likewise. * g++.dg/cpp0x/pr68726.C: Likewise. * g++.dg/cpp0x/pr78341.C: Likewise. * g++.dg/cpp1y/pr65202.C: Likewise. * g++.dg/cpp1z/class-deduction44.C: Likewise. * g++.dg/diagnostic/unclosed-extern-c.C: Likewise. * g++.dg/diagnostic/unclosed-function.C: Likewise. * g++.dg/diagnostic/unclosed-namespace.C: Likewise. * g++.dg/diagnostic/unclosed-struct.C: Likewise. * g++.dg/ext/pr84598.C: Likewise. * g++.dg/other/switch4.C: Likewise. * g++.dg/parse/crash10.C: Likewise. * g++.dg/parse/crash18.C: Likewise. * g++.dg/parse/crash35.C: Likewise. * g++.dg/parse/crash59.C: Likewise. * g++.dg/parse/crash61.C: Likewise. * g++.dg/parse/crash67.C: Likewise. * g++.dg/parse/ctor3.C: Likewise. * g++.dg/parse/error14.C: Likewise. * g++.dg/parse/error5.C: Likewise. * g++.dg/parse/error56.C: Likewise. * g++.dg/parse/invalid1.C: Likewise. * g++.dg/parse/parameter-declaration-1.C: Likewise. * g++.dg/parse/parser-pr28152-2.C: Likewise. * g++.dg/parse/parser-pr28152.C: Likewise. * g++.dg/parse/pr68722.C: Likewise. * g++.dg/pr46852.C: Likewise. * g++.dg/pr46868.C: Likewise. * g++.dg/template/crash115.C: Likewise. * g++.dg/template/crash43.C: Likewise. * g++.dg/template/error-recovery1.C: Likewise. * g++.dg/template/error57.C: Likewise. * g++.old-deja/g++.other/crash31.C: Likewise.
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/parser.c5
-rw-r--r--gcc/testsuite/ChangeLog38
-rw-r--r--gcc/testsuite/c-c++-common/raw-string-6.c5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype63.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr68726.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/pr78341.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/pr65202.C3
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/class-deduction44.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-function.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C3
-rw-r--r--gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/pr84598.C3
-rw-r--r--gcc/testsuite/g++.dg/other/switch4.C1
-rw-r--r--gcc/testsuite/g++.dg/parse/crash10.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/crash18.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash35.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash59.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/crash61.C1
-rw-r--r--gcc/testsuite/g++.dg/parse/crash67.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/ctor3.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error14.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/error5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/error56.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/invalid1.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/parameter-declaration-1.C3
-rw-r--r--gcc/testsuite/g++.dg/parse/parser-pr28152-2.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/parser-pr28152.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/pr68722.C4
-rw-r--r--gcc/testsuite/g++.dg/pr46852.C3
-rw-r--r--gcc/testsuite/g++.dg/pr46868.C1
-rw-r--r--gcc/testsuite/g++.dg/template/crash115.C1
-rw-r--r--gcc/testsuite/g++.dg/template/crash43.C4
-rw-r--r--gcc/testsuite/g++.dg/template/error-recovery1.C3
-rw-r--r--gcc/testsuite/g++.dg/template/error57.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash31.C3
38 files changed, 104 insertions, 43 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0c19a6f..1c3d08d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2020-05-08 Nathan Sidwell <nathan@acm.org>
+
+ * parser.c (cp_lexer_set_source_position_from_token): EOF has a
+ location too.
+
2020-05-07 Iain Sandoe <iain@sandoe.co.uk>
PR c++/94817
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index d67fa3b..591f44f 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -895,10 +895,7 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer, cp_token *token)
static inline void
cp_lexer_set_source_position_from_token (cp_token *token)
{
- if (token->type != CPP_EOF)
- {
- input_location = token->location;
- }
+ input_location = token->location;
}
/* Update the globals input_location and the input file stack from LEXER. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8dc87d3..f54ebc8 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,41 @@
+2020-05-08 Nathan Sidwell <nathan@acm.org>
+
+ * c-c++-common/raw-string-6.c: Adjust EOF error location.
+ * g++.dg/cpp0x/decltype63.C: Likewise.
+ * g++.dg/cpp0x/gen-attrs-64.C: Likewise.
+ * g++.dg/cpp0x/pr68726.C: Likewise.
+ * g++.dg/cpp0x/pr78341.C: Likewise.
+ * g++.dg/cpp1y/pr65202.C: Likewise.
+ * g++.dg/cpp1z/class-deduction44.C: Likewise.
+ * g++.dg/diagnostic/unclosed-extern-c.C: Likewise.
+ * g++.dg/diagnostic/unclosed-function.C: Likewise.
+ * g++.dg/diagnostic/unclosed-namespace.C: Likewise.
+ * g++.dg/diagnostic/unclosed-struct.C: Likewise.
+ * g++.dg/ext/pr84598.C: Likewise.
+ * g++.dg/other/switch4.C: Likewise.
+ * g++.dg/parse/crash10.C: Likewise.
+ * g++.dg/parse/crash18.C: Likewise.
+ * g++.dg/parse/crash35.C: Likewise.
+ * g++.dg/parse/crash59.C: Likewise.
+ * g++.dg/parse/crash61.C: Likewise.
+ * g++.dg/parse/crash67.C: Likewise.
+ * g++.dg/parse/ctor3.C: Likewise.
+ * g++.dg/parse/error14.C: Likewise.
+ * g++.dg/parse/error5.C: Likewise.
+ * g++.dg/parse/error56.C: Likewise.
+ * g++.dg/parse/invalid1.C: Likewise.
+ * g++.dg/parse/parameter-declaration-1.C: Likewise.
+ * g++.dg/parse/parser-pr28152-2.C: Likewise.
+ * g++.dg/parse/parser-pr28152.C: Likewise.
+ * g++.dg/parse/pr68722.C: Likewise.
+ * g++.dg/pr46852.C: Likewise.
+ * g++.dg/pr46868.C: Likewise.
+ * g++.dg/template/crash115.C: Likewise.
+ * g++.dg/template/crash43.C: Likewise.
+ * g++.dg/template/error-recovery1.C: Likewise.
+ * g++.dg/template/error57.C: Likewise.
+ * g++.old-deja/g++.other/crash31.C: Likewise.
+
2020-05-08 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/addr15.adb: New test.
diff --git a/gcc/testsuite/c-c++-common/raw-string-6.c b/gcc/testsuite/c-c++-common/raw-string-6.c
index 2c2d5b2..a2cb30e 100644
--- a/gcc/testsuite/c-c++-common/raw-string-6.c
+++ b/gcc/testsuite/c-c++-common/raw-string-6.c
@@ -2,5 +2,6 @@
// { dg-options "-std=gnu99" { target c } }
// { dg-options "-std=c++0x" { target c++ } }
-const void *s0 = R"ouch()ouCh"; // { dg-error "at end of input" "end" }
- // { dg-error "unterminated raw string" "unterminated" { target *-*-* } .-1 }
+const void *s0 = R"ouch()ouCh"; // { dg-error "unterminated raw string" "unterminated" }
+// { dg-error "at end of input" "end" { target c } .-1 }
+// { dg-error "-:at end of input" "end" { target c++ } .+1 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype63.C b/gcc/testsuite/g++.dg/cpp0x/decltype63.C
index 60dfec4..7dded0a 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype63.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype63.C
@@ -4,4 +4,5 @@
template<typename T>
class C{
T t;
- decltype(t)::a:: // { dg-error "expected" }
+ decltype(t)::a:: // { dg-error "expected" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
index 4b335eb..7fb7c33 100644
--- a/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
+++ b/gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
@@ -1,4 +1,5 @@
// PR c++/85140
// { dg-do compile { target c++11 } }
-namespace alignas() N {} // { dg-error "expected" }
+namespace alignas() N {} // { dg-error "expected" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr68726.C b/gcc/testsuite/g++.dg/cpp0x/pr68726.C
index 64572e5..262a102 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr68726.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr68726.C
@@ -4,4 +4,5 @@ template <typename> struct A {
template <typename, > struct __construct_helper; // { dg-error "expected" }
template <typename... _Args>
using __has_construct typename __construct_helper<_Args...>::type; // { dg-error "expected" }
-} struct : A<int> { // { dg-error "expected" }
+} struct : A<int> { // { dg-error "expected" }
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr78341.C b/gcc/testsuite/g++.dg/cpp0x/pr78341.C
index af90638..dbf0059 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr78341.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr78341.C
@@ -1,4 +1,5 @@
// PR c++/78341
// { dg-do compile { target c++11 } }
-alignas (alignas double // { dg-error "" }
+alignas (alignas double // { dg-error "expected" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/cpp1y/pr65202.C b/gcc/testsuite/g++.dg/cpp1y/pr65202.C
index 43eb01f..0d217c7 100644
--- a/gcc/testsuite/g++.dg/cpp1y/pr65202.C
+++ b/gcc/testsuite/g++.dg/cpp1y/pr65202.C
@@ -24,4 +24,5 @@ int main()
{
foo<ns::bar> f;
adl::swap(f, f) // { dg-error "expected ';'" }
-} // { dg-error "expected '.'" "expected end of namespace" }
+}
+// { dg-error "-:expected '.'" "expected end of namespace" }
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
index 225652c..af91c89 100644
--- a/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
+++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
@@ -2,4 +2,5 @@
// { dg-do compile { target c++17 } }
template <typename> struct A;
-template <typename> struct B : A < B { , // { dg-error "" }
+template <typename> struct B : A < B { , // { dg-error "" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
index 44f538e..4a2519b 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
@@ -8,5 +8,6 @@ template <typename T> // { dg-error "template with C linkage" }
void bar (void);
// { dg-message "1: 'extern .C.' linkage started here" "" { target *-*-* } open_extern_c }
-void test (void); /* { dg-error "17: expected '.' at end of input" } */
+void test (void);
// { message "12: to match this '.'" "" { target *-*-* } open_extern_c }
+/* { dg-error "-:expected '.' at end of input" } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
index e1e1550..c3a0bc6 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
@@ -1,3 +1,4 @@
void test (void)
{ /* { dg-message "1: to match this '.'" } */
- int filler; /* { dg-error "13: expected '.' at end of input" } */
+ int filler;
+ /* { dg-error "-:expected '.' at end of input" } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
index ff11322..959354f 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
@@ -1,2 +1,3 @@
namespace unclosed { /* { dg-message "20: to match this '.'" } */
-int filler; /* { dg-error "11: expected '.' at end of input" } */
+int filler;
+/* { dg-error "-:expected '.' at end of input" } */
diff --git a/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C b/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
index 8c206bb..cf8f1e4 100644
--- a/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
+++ b/gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
@@ -1,3 +1,3 @@
struct unclosed { /* { dg-message "17: to match this '.'" } */
- int dummy; /* { dg-error "12: expected '.' at end of input" } */
- // { dg-error "expected unqualified-id at end of input" "" { target *-*-* } .-1 }
+ int dummy;
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/ext/pr84598.C b/gcc/testsuite/g++.dg/ext/pr84598.C
index 05016b8..4b2cc07 100644
--- a/gcc/testsuite/g++.dg/ext/pr84598.C
+++ b/gcc/testsuite/g++.dg/ext/pr84598.C
@@ -1,3 +1,4 @@
// { dg-options "-fpermissive -w" }
-template<int b> __attribute__ a([] { class c, __attribute__(vector_size(operator+()))) d; // { dg-error "expected" }
+template<int b> __attribute__ a([] { class c, __attribute__(vector_size(operator+()))) d; // { dg-error "" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/other/switch4.C b/gcc/testsuite/g++.dg/other/switch4.C
index 42acb1b..6320346 100644
--- a/gcc/testsuite/g++.dg/other/switch4.C
+++ b/gcc/testsuite/g++.dg/other/switch4.C
@@ -4,3 +4,4 @@ class a b; // { dg-error "aggregate" }
void c() {
switch () // { dg-error "expected" }
case b // { dg-error "expected" }
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/crash10.C b/gcc/testsuite/g++.dg/parse/crash10.C
index 2482242..0a1a703 100644
--- a/gcc/testsuite/g++.dg/parse/crash10.C
+++ b/gcc/testsuite/g++.dg/parse/crash10.C
@@ -5,9 +5,8 @@
// PR c++ 10953. ICE
-// { dg-bogus "" "" { target *-*-* } 14 }
-
class
{
typename::
-; // { dg-error "" }
+; // { dg-error "expected" }
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/crash18.C b/gcc/testsuite/g++.dg/parse/crash18.C
index 7e326aa..bf68be1 100644
--- a/gcc/testsuite/g++.dg/parse/crash18.C
+++ b/gcc/testsuite/g++.dg/parse/crash18.C
@@ -4,4 +4,4 @@
// PR 18095: ICE
// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
-struct A // { dg-error "expected" }
+struct A // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/crash35.C b/gcc/testsuite/g++.dg/parse/crash35.C
index 161edad..3cae709 100644
--- a/gcc/testsuite/g++.dg/parse/crash35.C
+++ b/gcc/testsuite/g++.dg/parse/crash35.C
@@ -4,4 +4,4 @@
struct a {};
class foo : public a, a // { dg-error "duplicate base" }
-{ /* { dg-error "at end of input" } */
+{ // { dg-error "-:at end of input" }
diff --git a/gcc/testsuite/g++.dg/parse/crash59.C b/gcc/testsuite/g++.dg/parse/crash59.C
index 7e90dde..5994751 100644
--- a/gcc/testsuite/g++.dg/parse/crash59.C
+++ b/gcc/testsuite/g++.dg/parse/crash59.C
@@ -1,4 +1,4 @@
// PR c++/53003
struct A{ void a{} return b // { dg-error "16:function definition" }
-// { dg-error "expected" "" { target *-*-* } .-1 }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/crash61.C b/gcc/testsuite/g++.dg/parse/crash61.C
index b2004b8..e41e151 100644
--- a/gcc/testsuite/g++.dg/parse/crash61.C
+++ b/gcc/testsuite/g++.dg/parse/crash61.C
@@ -5,3 +5,4 @@
struct pair { constexpr pair (const) : }; // { dg-error "" }
template <0> make_pair () {} // { dg-error "" }
pair prefix[] = { 0, make_pair } // { dg-error "" }
+// { dg-error "-:expected" "" { target c++11 } }
diff --git a/gcc/testsuite/g++.dg/parse/crash67.C b/gcc/testsuite/g++.dg/parse/crash67.C
index dee0fc7..8ae6e32 100644
--- a/gcc/testsuite/g++.dg/parse/crash67.C
+++ b/gcc/testsuite/g++.dg/parse/crash67.C
@@ -3,4 +3,5 @@
class x0;
template <x1> x2() { // { dg-error "declared|type" }
-x0 x3 = x3. // { dg-error "expected|incomplete type" }
+x0 x3 = x3. // { dg-error "incomplete type" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/ctor3.C b/gcc/testsuite/g++.dg/parse/ctor3.C
index e597d92..786f9fc 100644
--- a/gcc/testsuite/g++.dg/parse/ctor3.C
+++ b/gcc/testsuite/g++.dg/parse/ctor3.C
@@ -4,5 +4,5 @@ struct A {};
struct B : A
{
- B() : A {} // { dg-error "initializer|expected" }
-};
+ B() : A {} // { dg-error "initializer" "" { target c++98_only } }
+}; // { dg-error "expected" }
diff --git a/gcc/testsuite/g++.dg/parse/error14.C b/gcc/testsuite/g++.dg/parse/error14.C
index e87ce83..15ebe24 100644
--- a/gcc/testsuite/g++.dg/parse/error14.C
+++ b/gcc/testsuite/g++.dg/parse/error14.C
@@ -19,6 +19,5 @@ struct X
Zinc<int>( //);
// }
-}; // { dg-error "2:expected '.' at end of input" "at end of input" }
- // { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } .-1 }
- // { dg-error "1:expected unqualified-id" "unqualified-id" { target *-*-* } .-2 }
+}; // { dg-error "1:expected primary-expression before '.' token" "primary" }
+// { dg-error "-:expected" "at end of input" }
diff --git a/gcc/testsuite/g++.dg/parse/error5.C b/gcc/testsuite/g++.dg/parse/error5.C
index 576ae9f..53a4621 100644
--- a/gcc/testsuite/g++.dg/parse/error5.C
+++ b/gcc/testsuite/g++.dg/parse/error5.C
@@ -12,7 +12,7 @@ class Foo { int foo() return 0; } };
// message has been generated by cp_parser_error() which does not
// necessarily allow accurate column number display. At some point, we will
// need make cp_parser_error() report more accurate column numbers.
-// { dg-error "30:expected '\{' at end of input" "brace" { target *-*-* } 5 }
+// { dg-error "31:expected '\{' at end of input" "brace" { target *-*-* } 5 }
// { dg-error "34:expected ';' after class definition" "semicolon" {target *-*-* } 5 }
diff --git a/gcc/testsuite/g++.dg/parse/error56.C b/gcc/testsuite/g++.dg/parse/error56.C
index 7c81ab4..aa0b5d2 100644
--- a/gcc/testsuite/g++.dg/parse/error56.C
+++ b/gcc/testsuite/g++.dg/parse/error56.C
@@ -2,4 +2,6 @@
template <0> int __copy_streambufs_eof; // { dg-error "" }
class {
+// { dg-error "forbids" "" { target *-*-* } .+1 }
friend __copy_streambufs_eof <> ( // { dg-error "" }
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/invalid1.C b/gcc/testsuite/g++.dg/parse/invalid1.C
index f72e277..72bc720 100644
--- a/gcc/testsuite/g++.dg/parse/invalid1.C
+++ b/gcc/testsuite/g++.dg/parse/invalid1.C
@@ -2,4 +2,5 @@
// { dg-do compile { target c++11 } }
// { dg-options "-w" }
-int foo ( foo += *[ // { dg-error "" }
+int foo ( foo += *[ // { dg-error "expected" }
+// { dg-error "-:invalid|expected" }
diff --git a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
index 5ff3fb2..98e82c8 100644
--- a/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
+++ b/gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
@@ -3,4 +3,5 @@
// { dg-do compile }
struct {
- a(void = 0; a(0), a(0) // { dg-error "" }
+ a(void = 0; a(0), a(0) // { dg-error "" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C b/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
index 11e1063..bf32924 100644
--- a/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
+++ b/gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
@@ -8,4 +8,4 @@ main (void)
z = __complex__ (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '__complex__'" "primary-expression" }
z = __complex__ (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '__complex__'" "primaty-expression" }
- // { dg-error "at end of input" "end" { target *-*-* } .-1 }
+ // { dg-error "-:at end of input" "end" }
diff --git a/gcc/testsuite/g++.dg/parse/parser-pr28152.C b/gcc/testsuite/g++.dg/parse/parser-pr28152.C
index ceefee3..048cb50 100644
--- a/gcc/testsuite/g++.dg/parse/parser-pr28152.C
+++ b/gcc/testsuite/g++.dg/parse/parser-pr28152.C
@@ -8,4 +8,4 @@ main (void)
z = _Complex (1.90000007326203904e+19, 0.0); // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
z = _Complex (1.0e+0, 0.0) / z; // { dg-error "expected primary-expression before '_Complex'" "primary-expression" }
- // { dg-error "at end of input" "end" { target *-*-* } .-1 }
+ // { dg-error "-:at end of input" "end" }
diff --git a/gcc/testsuite/g++.dg/parse/pr68722.C b/gcc/testsuite/g++.dg/parse/pr68722.C
index 44a6213..2901cbf 100644
--- a/gcc/testsuite/g++.dg/parse/pr68722.C
+++ b/gcc/testsuite/g++.dg/parse/pr68722.C
@@ -4,6 +4,6 @@ class A {
&__loc // { dg-error "" }
} class ios_base { // { dg-error "" }
A _M_ios_locale ios_base(ios_base &) template <_Traits> class basic_ios { // { dg-error "" }
-basic_ios basic_ios = operator= // { dg-error "" }
-
+ basic_ios basic_ios = operator= // { dg-error "" }
// { dg-prune-output "file ends in default argument" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/pr46852.C b/gcc/testsuite/g++.dg/pr46852.C
index 2c9d8dd..9be1b92 100644
--- a/gcc/testsuite/g++.dg/pr46852.C
+++ b/gcc/testsuite/g++.dg/pr46852.C
@@ -4,4 +4,5 @@
template
<
class
-{ // { dg-error "" }
+{ // { dg-error "" }
+// { dg-error "-:" }
diff --git a/gcc/testsuite/g++.dg/pr46868.C b/gcc/testsuite/g++.dg/pr46868.C
index 544c7b2..dec79aa 100644
--- a/gcc/testsuite/g++.dg/pr46868.C
+++ b/gcc/testsuite/g++.dg/pr46868.C
@@ -2,3 +2,4 @@
// { dg-do compile }
template < int > struct S { S < // { dg-error "" }
+ // { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/template/crash115.C b/gcc/testsuite/g++.dg/template/crash115.C
index 80f8683..84b2847 100644
--- a/gcc/testsuite/g++.dg/template/crash115.C
+++ b/gcc/testsuite/g++.dg/template/crash115.C
@@ -1,3 +1,4 @@
// PR c++/56534
template < struct template rebind < > // { dg-error "expected|must follow" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/template/crash43.C b/gcc/testsuite/g++.dg/template/crash43.C
index cbb1221..a5161d8 100644
--- a/gcc/testsuite/g++.dg/template/crash43.C
+++ b/gcc/testsuite/g++.dg/template/crash43.C
@@ -4,5 +4,5 @@ extern "C" {
template<typename _Tp> // { dg-error "C" }
struct ___is_pod {
enum {
- __value = (sizeof(__gnu_internal::__test_type<_Tp>(0)))}; // { dg-error "declared|expected" }
-
+ __value = (sizeof(__gnu_internal::__test_type<_Tp>(0)))}; // { dg-error "expected|declared" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/template/error-recovery1.C b/gcc/testsuite/g++.dg/template/error-recovery1.C
index ef9dc14..05f3980 100644
--- a/gcc/testsuite/g++.dg/template/error-recovery1.C
+++ b/gcc/testsuite/g++.dg/template/error-recovery1.C
@@ -6,4 +6,5 @@ template < typename > struct T
template < typename >
template < bool > struct T < S > // { dg-error "" }
{
- void f () { // { dg-error "" }
+ void f () { // { dg-error "expected" }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.dg/template/error57.C b/gcc/testsuite/g++.dg/template/error57.C
index f67e0a6..f3d87c5 100644
--- a/gcc/testsuite/g++.dg/template/error57.C
+++ b/gcc/testsuite/g++.dg/template/error57.C
@@ -2,4 +2,4 @@
template <int()> struct a;
template <int(b)> a < b // { dg-error "int" }
-// { dg-error "expected" "" { target *-*-* } .-1 }
+// { dg-error "-:expected" }
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash31.C b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
index b6d1952..734c3f4 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash31.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash31.C
@@ -6,4 +6,5 @@ namespace bar
struct foo
{
foo();
-}; // { dg-error "expected" }
+};
+// { dg-error "-:expected" }