From: Nathan Sidwell Date: Fri, 8 May 2020 15:43:16 +0000 (-0700) Subject: EOF has a location X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=debfaee5d51e3c07bb88a971618de2baff35d9c0;p=gcc.git 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. --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0c19a6fe47c..1c3d08d693b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2020-05-08 Nathan Sidwell + + * parser.c (cp_lexer_set_source_position_from_token): EOF has a + location too. + 2020-05-07 Iain Sandoe PR c++/94817 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index d67fa3b13d1..591f44f4934 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 8dc87d3948d..f54ebc89446 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,41 @@ +2020-05-08 Nathan Sidwell + + * 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 * 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 2c2d5b2d9ef..a2cb30e96c9 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 60dfec47a41..7dded0aedd8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype63.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype63.C @@ -4,4 +4,5 @@ template 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 4b335eb2818..7fb7c3358fc 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 64572e5ee46..262a1027c43 100644 --- a/gcc/testsuite/g++.dg/cpp0x/pr68726.C +++ b/gcc/testsuite/g++.dg/cpp0x/pr68726.C @@ -4,4 +4,5 @@ template struct A { template struct __construct_helper; // { dg-error "expected" } template using __has_construct typename __construct_helper<_Args...>::type; // { dg-error "expected" } -} struct : A { // { dg-error "expected" } +} struct : A { // { 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 af906384098..dbf0059a6ff 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 43eb01f1fcb..0d217c7bc4e 100644 --- a/gcc/testsuite/g++.dg/cpp1y/pr65202.C +++ b/gcc/testsuite/g++.dg/cpp1y/pr65202.C @@ -24,4 +24,5 @@ int main() { foo 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 225652cd2e4..af91c89e463 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 struct A; -template struct B : A < B { , // { dg-error "" } +template 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 44f538e33ec..4a2519b3a7c 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 // { 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 e1e15504172..c3a0bc67868 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 ff113226cc7..959354fc912 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 8c206bbecc4..cf8f1e419bb 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 05016b82b8c..4b2cc07b474 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 __attribute__ a([] { class c, __attribute__(vector_size(operator+()))) d; // { dg-error "expected" } +template __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 42acb1b0d95..63203460a39 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 24822423488..0a1a70349f1 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 7e326aa9827..bf68be1a73c 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 -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 161edad32a2..3cae70949db 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 7e90dde6c8a..59947515943 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 b2004b85173..e41e15105af 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 dee0fc72212..8ae6e32aa50 100644 --- a/gcc/testsuite/g++.dg/parse/crash67.C +++ b/gcc/testsuite/g++.dg/parse/crash67.C @@ -3,4 +3,5 @@ class x0; template 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 e597d926f40..786f9fc98c1 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 e87ce83201d..15ebe24f4d7 100644 --- a/gcc/testsuite/g++.dg/parse/error14.C +++ b/gcc/testsuite/g++.dg/parse/error14.C @@ -19,6 +19,5 @@ struct X Zinc( //); // } -}; // { 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 576ae9fd09b..53a46219a35 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 7c81ab4488f..aa0b5d2bed2 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 f72e277488d..72bc720bedc 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 5ff3fb21929..98e82c89223 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 11e1063e12a..bf329248f6b 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 ceefee3790c..048cb501a57 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 44a6213a0a6..2901cbfe191 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 2c9d8dd4144..9be1b92413c 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 544c7b219df..dec79aaf114 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 80f8683a136..84b284770ee 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 cbb1221b355..a5161d887b9 100644 --- a/gcc/testsuite/g++.dg/template/crash43.C +++ b/gcc/testsuite/g++.dg/template/crash43.C @@ -4,5 +4,5 @@ extern "C" { template // { 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 ef9dc141bc7..05f39803071 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 f67e0a6fa63..f3d87c53bca 100644 --- a/gcc/testsuite/g++.dg/template/error57.C +++ b/gcc/testsuite/g++.dg/template/error57.C @@ -2,4 +2,4 @@ template struct a; template 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 b6d19527a5a..734c3f4e31a 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" }