diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-05-19 17:51:31 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-05-19 17:51:31 +0000 |
commit | 7fb80849cb4af6c1f90c2464a38f2b20a8e3d0fb (patch) | |
tree | a9e4cfc018d804127514c896e8b3b59d6f2247d1 /gcc | |
parent | 883755a164ac5e56b049e8bf3b68d12eab3962a9 (diff) | |
download | gcc-7fb80849cb4af6c1f90c2464a38f2b20a8e3d0fb.zip gcc-7fb80849cb4af6c1f90c2464a38f2b20a8e3d0fb.tar.gz gcc-7fb80849cb4af6c1f90c2464a38f2b20a8e3d0fb.tar.bz2 |
typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
/cp
2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
* typeck2.c (cxx_incomplete_type_diagnostic): Use inform.
* parser.c (cp_parser_enum_specifier): Likewise.
/testsuite
2014-05-19 Paolo Carlini <paolo.carlini@oracle.com>
* c-c++-common/gomp/simd4.c: Adjust for inform.
* g++.dg/cpp0x/decltype-call1.C: Likewise.
* g++.dg/cpp0x/forw_enum6.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-ice7.C: Likewise.
* g++.dg/cpp0x/noexcept15.C: Likewise.
* g++.dg/cpp0x/variadic-ex2.C: Likewise.
* g++.dg/eh/spec6.C: Likewise.
* g++.dg/expr/cast1.C: Likewise.
* g++.dg/expr/dtor1.C: Likewise.
* g++.dg/ext/is_base_of_diagnostic.C: Likewise.
* g++.dg/ext/unary_trait_incomplete.C: Likewise.
* g++.dg/gomp/pr49223-2.C: Likewise.
* g++.dg/gomp/udr-4.C: Likewise.
* g++.dg/init/delete1.C: Likewise.
* g++.dg/other/crash-2.C: Likewise.
* g++.dg/parse/crash24.C: Likewise.
* g++.dg/parse/crash25.C: Likewise.
* g++.dg/parse/crash31.C: Likewise.
* g++.dg/parse/crash49.C: Likewise.
* g++.dg/parse/crash50.C: Likewise.
* g++.dg/parse/crash54.C: Likewise.
* g++.dg/parse/dtor7.C: Likewise.
* g++.dg/parse/error40.C: Likewise.
* g++.dg/parse/fused-params1.C: Likewise.
* g++.dg/parse/new1.C: Likewise.
* g++.dg/template/crash35.C: Likewise.
* g++.dg/template/crash59.C: Likewise.
* g++.dg/template/crash77.C: Likewise.
* g++.dg/template/error51.C: Likewise.
* g++.dg/template/incomplete1.C: Likewise.
* g++.dg/template/incomplete3.C: Likewise.
* g++.dg/template/incomplete4.C: Likewise.
* g++.dg/template/incomplete5.C: Likewise.
* g++.dg/template/inherit8.C: Likewise.
* g++.dg/template/instantiate1.C: Likewise.
* g++.dg/template/instantiate3.C: Likewis: Likewise.
* g++.dg/template/offsetof2.C: Likewise.
* g++.dg/tm/pr51928.C: Likewise.
* g++.dg/warn/Wdelete-incomplete-1.C: Likewise.
* g++.dg/warn/incomplete1.C: Likewise.
* g++.dg/warn/incomplete2.C: Likewise.
* g++.old-deja/g++.brendan/friend4.C: Likewise.
* g++.old-deja/g++.bugs/900121_01.C: Likewise.
* g++.old-deja/g++.bugs/900214_01.C: Likewise.
* g++.old-deja/g++.eh/catch1.C: Likewise.
* g++.old-deja/g++.eh/spec6.C: Likewise.
* g++.old-deja/g++.mike/p7868.C: Likewise.
* g++.old-deja/g++.other/crash38.C: Likewise.
* g++.old-deja/g++.other/enum2.C: Likewise.
* g++.old-deja/g++.other/incomplete.C: Likewise.
* g++.old-deja/g++.other/vaarg3.C: Likewise.
* g++.old-deja/g++.pt/crash9.C: Likewise.
* g++.old-deja/g++.pt/niklas01a.C: Likewise.
* g++.old-deja/g++.pt/typename8.C: Likewise.
* g++.old-deja/g++.robertl/ice990323-1.C: Likewise.
From-SVN: r210623
Diffstat (limited to 'gcc')
59 files changed, 143 insertions, 77 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b5ad1af..1b0916c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-05-19 Paolo Carlini <paolo.carlini@oracle.com> + + * typeck2.c (cxx_incomplete_type_diagnostic): Use inform. + * parser.c (cp_parser_enum_specifier): Likewise. + 2014-05-17 Trevor Saunders <tsaunders@mozilla.com> * class.c (sorted_fields_type_new): Adjust. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 031fa9d..0c9e113 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15540,9 +15540,10 @@ cp_parser_enum_specifier (cp_parser* parser) } else { - error_at (type_start_token->location, "multiple definition of %q#T", type); - error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)), - "previous definition here"); + error_at (type_start_token->location, + "multiple definition of %q#T", type); + inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)), + "previous definition here"); type = error_mark_node; } diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c index a0f39b6..fb1546f 100644 --- a/gcc/cp/typeck2.c +++ b/gcc/cp/typeck2.c @@ -438,7 +438,7 @@ void cxx_incomplete_type_diagnostic (const_tree value, const_tree type, diagnostic_t diag_kind) { - int decl = 0; + bool is_decl = false, complained = false; gcc_assert (diag_kind == DK_WARNING || diag_kind == DK_PEDWARN @@ -452,10 +452,10 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, || TREE_CODE (value) == PARM_DECL || TREE_CODE (value) == FIELD_DECL)) { - emit_diagnostic (diag_kind, input_location, 0, - "%q+D has incomplete type", value); - decl = 1; - } + complained = emit_diagnostic (diag_kind, input_location, 0, + "%q+D has incomplete type", value); + is_decl = true; + } retry: /* We must print an error message. Be clever about what it says. */ @@ -464,15 +464,19 @@ cxx_incomplete_type_diagnostic (const_tree value, const_tree type, case RECORD_TYPE: case UNION_TYPE: case ENUMERAL_TYPE: - if (!decl) - emit_diagnostic (diag_kind, input_location, 0, - "invalid use of incomplete type %q#T", type); - if (!TYPE_TEMPLATE_INFO (type)) - emit_diagnostic (diag_kind, input_location, 0, - "forward declaration of %q+#T", type); - else - emit_diagnostic (diag_kind, input_location, 0, - "declaration of %q+#T", type); + if (!is_decl) + complained = emit_diagnostic (diag_kind, input_location, 0, + "invalid use of incomplete type %q#T", + type); + if (complained) + { + if (!TYPE_TEMPLATE_INFO (type)) + inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)), + "forward declaration of %q#T", type); + else + inform (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)), + "declaration of %q#T", type); + } break; case VOID_TYPE: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2142b67..f4c9995 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,61 @@ +2014-05-19 Paolo Carlini <paolo.carlini@oracle.com> + + * c-c++-common/gomp/simd4.c: Adjust for inform. + * g++.dg/cpp0x/decltype-call1.C: Likewise. + * g++.dg/cpp0x/forw_enum6.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-ice7.C: Likewise. + * g++.dg/cpp0x/noexcept15.C: Likewise. + * g++.dg/cpp0x/variadic-ex2.C: Likewise. + * g++.dg/eh/spec6.C: Likewise. + * g++.dg/expr/cast1.C: Likewise. + * g++.dg/expr/dtor1.C: Likewise. + * g++.dg/ext/is_base_of_diagnostic.C: Likewise. + * g++.dg/ext/unary_trait_incomplete.C: Likewise. + * g++.dg/gomp/pr49223-2.C: Likewise. + * g++.dg/gomp/udr-4.C: Likewise. + * g++.dg/init/delete1.C: Likewise. + * g++.dg/other/crash-2.C: Likewise. + * g++.dg/parse/crash24.C: Likewise. + * g++.dg/parse/crash25.C: Likewise. + * g++.dg/parse/crash31.C: Likewise. + * g++.dg/parse/crash49.C: Likewise. + * g++.dg/parse/crash50.C: Likewise. + * g++.dg/parse/crash54.C: Likewise. + * g++.dg/parse/dtor7.C: Likewise. + * g++.dg/parse/error40.C: Likewise. + * g++.dg/parse/fused-params1.C: Likewise. + * g++.dg/parse/new1.C: Likewise. + * g++.dg/template/crash35.C: Likewise. + * g++.dg/template/crash59.C: Likewise. + * g++.dg/template/crash77.C: Likewise. + * g++.dg/template/error51.C: Likewise. + * g++.dg/template/incomplete1.C: Likewise. + * g++.dg/template/incomplete3.C: Likewise. + * g++.dg/template/incomplete4.C: Likewise. + * g++.dg/template/incomplete5.C: Likewise. + * g++.dg/template/inherit8.C: Likewise. + * g++.dg/template/instantiate1.C: Likewise. + * g++.dg/template/instantiate3.C: Likewis: Likewise. + * g++.dg/template/offsetof2.C: Likewise. + * g++.dg/tm/pr51928.C: Likewise. + * g++.dg/warn/Wdelete-incomplete-1.C: Likewise. + * g++.dg/warn/incomplete1.C: Likewise. + * g++.dg/warn/incomplete2.C: Likewise. + * g++.old-deja/g++.brendan/friend4.C: Likewise. + * g++.old-deja/g++.bugs/900121_01.C: Likewise. + * g++.old-deja/g++.bugs/900214_01.C: Likewise. + * g++.old-deja/g++.eh/catch1.C: Likewise. + * g++.old-deja/g++.eh/spec6.C: Likewise. + * g++.old-deja/g++.mike/p7868.C: Likewise. + * g++.old-deja/g++.other/crash38.C: Likewise. + * g++.old-deja/g++.other/enum2.C: Likewise. + * g++.old-deja/g++.other/incomplete.C: Likewise. + * g++.old-deja/g++.other/vaarg3.C: Likewise. + * g++.old-deja/g++.pt/crash9.C: Likewise. + * g++.old-deja/g++.pt/niklas01a.C: Likewise. + * g++.old-deja/g++.pt/typename8.C: Likewise. + * g++.old-deja/g++.robertl/ice990323-1.C: Likewise. + 2014-05-19 Joseph Myers <joseph@codesourcery.com> * lib/target-supports.exp diff --git a/gcc/testsuite/c-c++-common/gomp/simd4.c b/gcc/testsuite/c-c++-common/gomp/simd4.c index 37901b6..3990033 100644 --- a/gcc/testsuite/c-c++-common/gomp/simd4.c +++ b/gcc/testsuite/c-c++-common/gomp/simd4.c @@ -2,7 +2,7 @@ /* { dg-options "-fopenmp" } */ /* { dg-additional-options "-std=c99" { target c } } */ -struct S *p; /* { dg-error "forward declaration" "" { target c++ } } */ +struct S *p; /* { dg-message "forward declaration" "" { target c++ } } */ float f; int j; diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-call1.C b/gcc/testsuite/g++.dg/cpp0x/decltype-call1.C index 2616bb0..39069ba 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype-call1.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-call1.C @@ -2,7 +2,7 @@ // N3276 // { dg-do compile { target c++11 } } -struct A; // { dg-error "forward declaration" } +struct A; // { dg-message "forward declaration" } A f(); decltype(f()) g1(); // OK diff --git a/gcc/testsuite/g++.dg/cpp0x/forw_enum6.C b/gcc/testsuite/g++.dg/cpp0x/forw_enum6.C index ccce13a..7d2094d 100644 --- a/gcc/testsuite/g++.dg/cpp0x/forw_enum6.C +++ b/gcc/testsuite/g++.dg/cpp0x/forw_enum6.C @@ -25,10 +25,10 @@ enum class E3 e3; // { dg-error "scoped enum must not use" } enum struct E3 e4; // { dg-error "scoped enum must not use" } enum E5 : int e5; // { dg-error "expected|invalid type" } -enum E6 : int { a, b, c }; // { dg-error "previous definition" } +enum E6 : int { a, b, c }; // { dg-message "previous definition" } enum E6 : int { a, b, c }; // { dg-error "multiple definition" } -enum class E7 { }; // { dg-error "previous definition" } +enum class E7 { }; // { dg-message "previous definition" } enum class E7 { a, b, c }; // { dg-error "multiple definition" } namespace N1 diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C index d0ee866..1d7dfcc 100644 --- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice7.C @@ -1,7 +1,7 @@ // PR c++/52487 // { dg-do compile { target c++11 } } -struct A; // { dg-error "forward declaration" } +struct A; // { dg-message "forward declaration" } void foo(A& a) { diff --git a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C index 909ee97..5cbbea8 100644 --- a/gcc/testsuite/g++.dg/cpp0x/noexcept15.C +++ b/gcc/testsuite/g++.dg/cpp0x/noexcept15.C @@ -23,12 +23,10 @@ template<class Tp> return single<typename std::decay<Tp>::type>(x); } -class Blob; // { dg-error "forward declaration" } +class Blob; // { dg-message "forward declaration" } void foo(Blob *b) { make_single(*b); } - -// { dg-prune-output "include" } diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic-ex2.C b/gcc/testsuite/g++.dg/cpp0x/variadic-ex2.C index 015d9d8..a887e33 100644 --- a/gcc/testsuite/g++.dg/cpp0x/variadic-ex2.C +++ b/gcc/testsuite/g++.dg/cpp0x/variadic-ex2.C @@ -1,5 +1,5 @@ // { dg-do compile { target c++11 } } -template<class... Types> struct B { // { dg-error "declaration of" } +template<class... Types> struct B { // { dg-message "declaration of" } void f3(); void f4(); }; diff --git a/gcc/testsuite/g++.dg/eh/spec6.C b/gcc/testsuite/g++.dg/eh/spec6.C index eb1177b..d6d8176 100644 --- a/gcc/testsuite/g++.dg/eh/spec6.C +++ b/gcc/testsuite/g++.dg/eh/spec6.C @@ -3,7 +3,7 @@ // { dg-options "-fpermissive -w" } -struct A; // { dg-error "" } +struct A; // { dg-message "" } struct B { diff --git a/gcc/testsuite/g++.dg/expr/cast1.C b/gcc/testsuite/g++.dg/expr/cast1.C index ee1adcc..2f0e94f 100644 --- a/gcc/testsuite/g++.dg/expr/cast1.C +++ b/gcc/testsuite/g++.dg/expr/cast1.C @@ -1,3 +1,3 @@ -struct S; // { dg-error "forward" } +struct S; // { dg-message "forward" } void f(S* p) { ((S) (*p)); } // { dg-error "" } diff --git a/gcc/testsuite/g++.dg/expr/dtor1.C b/gcc/testsuite/g++.dg/expr/dtor1.C index 0775a93..5570f78 100644 --- a/gcc/testsuite/g++.dg/expr/dtor1.C +++ b/gcc/testsuite/g++.dg/expr/dtor1.C @@ -1,4 +1,4 @@ -class Foo; // { dg-error "" } +class Foo; // { dg-message "" } void bar(void* p) diff --git a/gcc/testsuite/g++.dg/ext/is_base_of_diagnostic.C b/gcc/testsuite/g++.dg/ext/is_base_of_diagnostic.C index 4ccc72b..aac6cfb 100644 --- a/gcc/testsuite/g++.dg/ext/is_base_of_diagnostic.C +++ b/gcc/testsuite/g++.dg/ext/is_base_of_diagnostic.C @@ -1,7 +1,7 @@ class A { }; -class B; // { dg-error "forward declaration" } +class B; // { dg-message "forward declaration" } union C { }; diff --git a/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C b/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C index ecc5ec2..b60ce84 100644 --- a/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C +++ b/gcc/testsuite/g++.dg/ext/unary_trait_incomplete.C @@ -1,6 +1,6 @@ // PR c++/39475 -struct I; // { dg-error "forward declaration" } +struct I; // { dg-message "forward declaration" } struct C { }; bool nas1 = __has_nothrow_assign(I); // { dg-error "incomplete type" } diff --git a/gcc/testsuite/g++.dg/gomp/pr49223-2.C b/gcc/testsuite/g++.dg/gomp/pr49223-2.C index 9539773..b367b04 100644 --- a/gcc/testsuite/g++.dg/gomp/pr49223-2.C +++ b/gcc/testsuite/g++.dg/gomp/pr49223-2.C @@ -3,7 +3,7 @@ // { dg-require-effective-target tls } // { dg-options "-fopenmp" } -struct S; // { dg-error "forward declaration" } +struct S; // { dg-message "forward declaration" } extern __thread struct S s; // { dg-error "has incomplete type" } struct T; extern __thread struct T t; diff --git a/gcc/testsuite/g++.dg/gomp/udr-4.C b/gcc/testsuite/g++.dg/gomp/udr-4.C index f1b388b..566d7d1 100644 --- a/gcc/testsuite/g++.dg/gomp/udr-4.C +++ b/gcc/testsuite/g++.dg/gomp/udr-4.C @@ -1,6 +1,6 @@ // { dg-do compile } -struct S; // { dg-error "forward declaration" } +struct S; // { dg-message "forward declaration" } #pragma omp declare reduction (+:S:omp_out.s += omp_in.s) // { dg-error "invalid use of incomplete type" } struct S { int s; S () : s (1) {} }; #pragma omp declare reduction (*:S:omp_out.s *= omp_in.s) diff --git a/gcc/testsuite/g++.dg/init/delete1.C b/gcc/testsuite/g++.dg/init/delete1.C index 304dca1..8236abc 100644 --- a/gcc/testsuite/g++.dg/init/delete1.C +++ b/gcc/testsuite/g++.dg/init/delete1.C @@ -1,6 +1,6 @@ // PR c++/19811 -class C; // { dg-warning "forward" } +class C; // { dg-message "forward" } void foo(void *p) { delete [] ((C*)p) ; // { dg-warning "problem|incomplete" } diff --git a/gcc/testsuite/g++.dg/other/crash-2.C b/gcc/testsuite/g++.dg/other/crash-2.C index 961a18a..b8645b0 100644 --- a/gcc/testsuite/g++.dg/other/crash-2.C +++ b/gcc/testsuite/g++.dg/other/crash-2.C @@ -3,7 +3,7 @@ // Contributed by Hans Buchmann <hans dot buchmann at fhso dot ch> // PR c++/14033: ICE while inlining a function with incomplete parameter -struct A; // { dg-error "forward declaration" } +struct A; // { dg-message "forward declaration" } void foo(A a) {} // { dg-error "incomplete" } struct A {}; diff --git a/gcc/testsuite/g++.dg/parse/crash24.C b/gcc/testsuite/g++.dg/parse/crash24.C index fdc4f1e..d0804b1 100644 --- a/gcc/testsuite/g++.dg/parse/crash24.C +++ b/gcc/testsuite/g++.dg/parse/crash24.C @@ -1,6 +1,6 @@ // PR c++/20461 // { dg-do compile } -class C; // { dg-error "forward declaration" } +class C; // { dg-message "forward declaration" } C::C() : f() {} // { dg-error "invalid use|does not have" } diff --git a/gcc/testsuite/g++.dg/parse/crash25.C b/gcc/testsuite/g++.dg/parse/crash25.C index d7f20c6..f0d8ffd 100644 --- a/gcc/testsuite/g++.dg/parse/crash25.C +++ b/gcc/testsuite/g++.dg/parse/crash25.C @@ -4,7 +4,7 @@ struct yyguts_t { - class TestScanner* yyextra_r; // { dg-error "forward declaration" } + class TestScanner* yyextra_r; // { dg-message "forward declaration" } }; TestScanner::TestScanner() {} // { dg-error "invalid use" } diff --git a/gcc/testsuite/g++.dg/parse/crash31.C b/gcc/testsuite/g++.dg/parse/crash31.C index b0a7e18..c22ad5e 100644 --- a/gcc/testsuite/g++.dg/parse/crash31.C +++ b/gcc/testsuite/g++.dg/parse/crash31.C @@ -1,4 +1,4 @@ -struct A // { dg-error "forward declaration" } +struct A // { dg-message "forward declaration" } { A : A; // { dg-error "expected|incomplete" } A : B; // { dg-error "not declared|incomplete" } diff --git a/gcc/testsuite/g++.dg/parse/crash49.C b/gcc/testsuite/g++.dg/parse/crash49.C index 07d7c3b..a922ef3 100644 --- a/gcc/testsuite/g++.dg/parse/crash49.C +++ b/gcc/testsuite/g++.dg/parse/crash49.C @@ -1,7 +1,7 @@ // PR c++/37552 // { dg-do compile } -extern struct A a[1]; // { dg-error "forward declaration" } +extern struct A a[1]; // { dg-message "forward declaration" } void foo () diff --git a/gcc/testsuite/g++.dg/parse/crash50.C b/gcc/testsuite/g++.dg/parse/crash50.C index 711048d..630eb25 100644 --- a/gcc/testsuite/g++.dg/parse/crash50.C +++ b/gcc/testsuite/g++.dg/parse/crash50.C @@ -2,7 +2,7 @@ // Origin PR c++/38636 // { dg-do compile } -struct A; // { dg-error "forward declaration of 'struct A'" } +struct A; // { dg-message "forward declaration of 'struct A'" } A::A( diff --git a/gcc/testsuite/g++.dg/parse/crash54.C b/gcc/testsuite/g++.dg/parse/crash54.C index 222082a..89d59ef 100644 --- a/gcc/testsuite/g++.dg/parse/crash54.C +++ b/gcc/testsuite/g++.dg/parse/crash54.C @@ -1,6 +1,6 @@ // PR c++/42057 -struct A; // { dg-error "forward declaration" } +struct A; // { dg-message "forward declaration" } struct B { diff --git a/gcc/testsuite/g++.dg/parse/dtor7.C b/gcc/testsuite/g++.dg/parse/dtor7.C index a809512..343b2e4 100644 --- a/gcc/testsuite/g++.dg/parse/dtor7.C +++ b/gcc/testsuite/g++.dg/parse/dtor7.C @@ -1,4 +1,4 @@ // PR c++/25856 -struct A; // { dg-error "forward" } +struct A; // { dg-message "forward" } A::~A() {} // { dg-error "incomplete" } diff --git a/gcc/testsuite/g++.dg/parse/error40.C b/gcc/testsuite/g++.dg/parse/error40.C index 9ab7552..643f1f5 100644 --- a/gcc/testsuite/g++.dg/parse/error40.C +++ b/gcc/testsuite/g++.dg/parse/error40.C @@ -1,7 +1,7 @@ // PR c++/31489 -class foo; // { dg-error "'class foo'" } -struct bar; // { dg-error "'struct bar'" } +class foo; // { dg-message "'class foo'" } +struct bar; // { dg-message "'struct bar'" } int main() { diff --git a/gcc/testsuite/g++.dg/parse/fused-params1.C b/gcc/testsuite/g++.dg/parse/fused-params1.C index 33732fc2..ebb226b 100644 --- a/gcc/testsuite/g++.dg/parse/fused-params1.C +++ b/gcc/testsuite/g++.dg/parse/fused-params1.C @@ -2,7 +2,7 @@ // Origin: Alexander Zvyagin <Alexander.Zviagine@cern.ch> // { dg-do compile } -template <int N,typename T> struct A // { dg-error "" } +template <int N,typename T> struct A // { dg-message "" } { typedef T X; template <int M> void foo (const A<M,X>&); diff --git a/gcc/testsuite/g++.dg/parse/new1.C b/gcc/testsuite/g++.dg/parse/new1.C index d61c446..d8c3766 100644 --- a/gcc/testsuite/g++.dg/parse/new1.C +++ b/gcc/testsuite/g++.dg/parse/new1.C @@ -1,4 +1,4 @@ -struct T; // { dg-error "forward" } +struct T; // { dg-message "forward" } T* manage(T* t); template <class Obj> struct ObjectSlot0_ { void create() { diff --git a/gcc/testsuite/g++.dg/template/crash35.C b/gcc/testsuite/g++.dg/template/crash35.C index 348d91d..c457798 100644 --- a/gcc/testsuite/g++.dg/template/crash35.C +++ b/gcc/testsuite/g++.dg/template/crash35.C @@ -1,7 +1,7 @@ // PR c++/20463 // { dg-do compile } -template <typename T> struct C; // { dg-error "declaration" } +template <typename T> struct C; // { dg-message "declaration" } template <typename T> void C<T>::f() // { dg-error "invalid|template" } { diff --git a/gcc/testsuite/g++.dg/template/crash59.C b/gcc/testsuite/g++.dg/template/crash59.C index 61d2188..ebc0e28 100644 --- a/gcc/testsuite/g++.dg/template/crash59.C +++ b/gcc/testsuite/g++.dg/template/crash59.C @@ -1,6 +1,6 @@ //PR c++/27329 -template<int> struct A // { dg-error "forward declaration" } +template<int> struct A // { dg-message "forward declaration" } ! // { dg-error "expected unqualified-id" } ; diff --git a/gcc/testsuite/g++.dg/template/crash77.C b/gcc/testsuite/g++.dg/template/crash77.C index b4d6e8f..2174779 100644 --- a/gcc/testsuite/g++.dg/template/crash77.C +++ b/gcc/testsuite/g++.dg/template/crash77.C @@ -1,5 +1,5 @@ // PR c++/34603 -template<typename> struct A; // { dg-error "declaration" } +template<typename> struct A; // { dg-message "declaration" } template<typename T> A<T>::A( struct A; // { dg-error "definition|expected|incomplete" } diff --git a/gcc/testsuite/g++.dg/template/error51.C b/gcc/testsuite/g++.dg/template/error51.C index b3a6cfb..304a13a 100644 --- a/gcc/testsuite/g++.dg/template/error51.C +++ b/gcc/testsuite/g++.dg/template/error51.C @@ -2,7 +2,7 @@ template<int> void foo() { - struct A; // { dg-error "declaration" } + struct A; // { dg-message "declaration" } struct B : A {}; // { dg-error "invalid use of incomplete" } } diff --git a/gcc/testsuite/g++.dg/template/incomplete1.C b/gcc/testsuite/g++.dg/template/incomplete1.C index e4997ef..53bd817 100644 --- a/gcc/testsuite/g++.dg/template/incomplete1.C +++ b/gcc/testsuite/g++.dg/template/incomplete1.C @@ -2,7 +2,7 @@ // Origin: Ivan Godard <igodard at pacbell dot net> // PR c++/17447: Detect parameters of dependent types even in templates -struct B; // { dg-error "forward declaration" } +struct B; // { dg-message "forward declaration" } template<typename T> struct A { friend A& operator <<(A& a, B b) { return a; } // { dg-error "incomplete" } diff --git a/gcc/testsuite/g++.dg/template/incomplete3.C b/gcc/testsuite/g++.dg/template/incomplete3.C index 8a20bba..9b2efb7 100644 --- a/gcc/testsuite/g++.dg/template/incomplete3.C +++ b/gcc/testsuite/g++.dg/template/incomplete3.C @@ -1,5 +1,5 @@ // PR c++/27315 // { dg-do compile } -struct A; // { dg-error "forward declaration" } +struct A; // { dg-message "forward declaration" } template void A::foo<0>(); // { dg-error "before|incomplete" } diff --git a/gcc/testsuite/g++.dg/template/incomplete4.C b/gcc/testsuite/g++.dg/template/incomplete4.C index 871e503..7cff66b 100644 --- a/gcc/testsuite/g++.dg/template/incomplete4.C +++ b/gcc/testsuite/g++.dg/template/incomplete4.C @@ -1,7 +1,7 @@ // PR c++/33501 // { dg-do compile } -class A; // { dg-error "forward declaration" } +class A; // { dg-message "forward declaration" } template <typename T> struct X { diff --git a/gcc/testsuite/g++.dg/template/incomplete5.C b/gcc/testsuite/g++.dg/template/incomplete5.C index b0a178b..1bd21b9 100644 --- a/gcc/testsuite/g++.dg/template/incomplete5.C +++ b/gcc/testsuite/g++.dg/template/incomplete5.C @@ -1,7 +1,7 @@ // PR c++/33501 // { dg-do compile } -class A; // { dg-error "forward declaration" } +class A; // { dg-message "forward declaration" } template <typename T> struct X { diff --git a/gcc/testsuite/g++.dg/template/inherit8.C b/gcc/testsuite/g++.dg/template/inherit8.C index 3176dc0..f2ebd5c 100644 --- a/gcc/testsuite/g++.dg/template/inherit8.C +++ b/gcc/testsuite/g++.dg/template/inherit8.C @@ -4,7 +4,7 @@ template <typename T> struct A { template <typename U> - struct B : public A <B<U> > // { dg-error "declaration" } + struct B : public A <B<U> > // { dg-message "declaration" } { struct C : public B<U> // { dg-error "incomplete" } { diff --git a/gcc/testsuite/g++.dg/template/instantiate1.C b/gcc/testsuite/g++.dg/template/instantiate1.C index dd50168..a9c8cf8 100644 --- a/gcc/testsuite/g++.dg/template/instantiate1.C +++ b/gcc/testsuite/g++.dg/template/instantiate1.C @@ -12,7 +12,7 @@ template <class T> struct Y { X<T> x; // { dg-message "required" } }; -template <class T> struct Z { // { dg-error "declaration" } +template <class T> struct Z { // { dg-message "declaration" } Y<Z<T> > y; // { dg-message "required" } }; diff --git a/gcc/testsuite/g++.dg/template/instantiate3.C b/gcc/testsuite/g++.dg/template/instantiate3.C index c0754da..e99ec84 100644 --- a/gcc/testsuite/g++.dg/template/instantiate3.C +++ b/gcc/testsuite/g++.dg/template/instantiate3.C @@ -4,7 +4,7 @@ // PR c++/7639 // ICE when accessing member with incomplete type. -class ACE_Null_Mutex; // { dg-error "forward declaration" } +class ACE_Null_Mutex; // { dg-message "forward declaration" } template <class TYPE> struct ACE_Cleanup_Adapter diff --git a/gcc/testsuite/g++.dg/template/offsetof2.C b/gcc/testsuite/g++.dg/template/offsetof2.C index da888f7..6f741a9 100644 --- a/gcc/testsuite/g++.dg/template/offsetof2.C +++ b/gcc/testsuite/g++.dg/template/offsetof2.C @@ -1,7 +1,7 @@ // PR c++/49085 template <class T> -struct A // { dg-error "declaration" } +struct A // { dg-message "declaration" } { int i, j; int ar[__builtin_offsetof(A,j)]; // { dg-error "incomplete type" } diff --git a/gcc/testsuite/g++.dg/tm/pr51928.C b/gcc/testsuite/g++.dg/tm/pr51928.C index 22dbadd..5ea0b04 100644 --- a/gcc/testsuite/g++.dg/tm/pr51928.C +++ b/gcc/testsuite/g++.dg/tm/pr51928.C @@ -1,7 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fgnu-tm" } */ -struct A; // { dg-error "forward declaration of 'struct A'" } +struct A; // { dg-message "forward declaration of 'struct A'" } struct B { diff --git a/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-1.C b/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-1.C index 69689ba..729ea21 100644 --- a/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-1.C +++ b/gcc/testsuite/g++.dg/warn/Wdelete-incomplete-1.C @@ -1,6 +1,6 @@ // PR c++/43452 -class Foo; // { dg-warning "forward" } +class Foo; // { dg-message "forward" } int main() { Foo* p; // { dg-warning "incomplete" } delete [] p; // { dg-warning "problem" } diff --git a/gcc/testsuite/g++.dg/warn/incomplete1.C b/gcc/testsuite/g++.dg/warn/incomplete1.C index 9dc645d..1fa2712 100644 --- a/gcc/testsuite/g++.dg/warn/incomplete1.C +++ b/gcc/testsuite/g++.dg/warn/incomplete1.C @@ -9,7 +9,7 @@ // (But the deletion does not constitute an ill-formed program. So the // program should nevertheless compile, but it should give a warning.) -class A; // { dg-warning "forward declaration of 'class A'" "" } +class A; // { dg-message "forward declaration of 'class A'" "" } A *a; // { dg-warning "'a' has incomplete type" "" } diff --git a/gcc/testsuite/g++.dg/warn/incomplete2.C b/gcc/testsuite/g++.dg/warn/incomplete2.C index c307c30..bfaf6be 100644 --- a/gcc/testsuite/g++.dg/warn/incomplete2.C +++ b/gcc/testsuite/g++.dg/warn/incomplete2.C @@ -1,7 +1,7 @@ // PR c++/33501 // { dg-do compile } -class A; // { dg-error "forward declaration" } +class A; // { dg-message "forward declaration" } int f (A); // { dg-message "initializing" } const A &make (); diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/friend4.C b/gcc/testsuite/g++.old-deja/g++.brendan/friend4.C index 4d436e5..dc55280 100644 --- a/gcc/testsuite/g++.old-deja/g++.brendan/friend4.C +++ b/gcc/testsuite/g++.old-deja/g++.brendan/friend4.C @@ -2,5 +2,5 @@ // GROUPS passed friends // do_friend should complain that foo was declared as a friend of // A before A was defined -struct A; // { dg-error "forward" } +struct A; // { dg-message "forward" } struct B { friend A::foo (); };// { dg-error "" } .* diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C index 3259163..da619b8 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900121_01.C @@ -7,7 +7,7 @@ // keywords: abort, incomplete types, reference types, formal parameters -struct s0; // { dg-error "" } forward declaration +struct s0; // { dg-message "" } forward declaration void function (struct s0 &arg1, struct s0 &arg2) { diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C index 88cafbf..4b161bf 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C @@ -8,7 +8,7 @@ // keywords: friends, incomplete types, function members -struct A; // { dg-error "" } forward declaration +struct A; // { dg-message "" } forward declaration struct B { friend void A::foo(); // { dg-error "" } type A is incomplete diff --git a/gcc/testsuite/g++.old-deja/g++.eh/catch1.C b/gcc/testsuite/g++.old-deja/g++.eh/catch1.C index 7aa70ac..67779d9 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/catch1.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/catch1.C @@ -5,7 +5,7 @@ // We cannot catch an incomplete type, or ptr to one -struct A; // { dg-error "" } forward decl +struct A; // { dg-message "" } forward decl void fn() { diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C index 7780c4a..85e9b4e 100644 --- a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C +++ b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C @@ -7,7 +7,7 @@ // [except.spec] 1, a type in an exception specifier shall not be incomplete, // or pointer or ref to incomplete -struct X; // { dg-error "" } forward declaration.* +struct X; // { dg-message "" } forward declaration.* void fn1() throw(X); // { dg-error "" } invalid use of undefined type void fn2() throw(X *); // { dg-error "" } invalid use of undefined type void fn3() throw(X &); // { dg-error "" } invalid use of undefined tyoe diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p7868.C b/gcc/testsuite/g++.old-deja/g++.mike/p7868.C index 48bdf8b..8a94b3e 100644 --- a/gcc/testsuite/g++.old-deja/g++.mike/p7868.C +++ b/gcc/testsuite/g++.old-deja/g++.mike/p7868.C @@ -4,13 +4,13 @@ struct DIAGTYP { }; struct DIAGTYP1 { - struct DIAGTYP; // { dg-error "" } forward declaration + struct DIAGTYP; // { dg-message "" } forward declaration void bar() { new struct DIAGTYP; } // { dg-error "" } undefined void foo() { new struct DIAGTYP1; } }; int main () { - struct DIAGTYP; // { dg-error "" } forward declaration + struct DIAGTYP; // { dg-message "" } forward declaration struct DIAGTYP *lerror_desc; lerror_desc= new struct DIAGTYP; // { dg-error "" } undefined } diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash38.C b/gcc/testsuite/g++.old-deja/g++.other/crash38.C index d07115e..87e5555 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/crash38.C +++ b/gcc/testsuite/g++.old-deja/g++.other/crash38.C @@ -6,7 +6,7 @@ // Bug 611. We ICEd when calling a member function returning an incomplete // type by value. -struct X; // { dg-error "" } forward ref +struct X; // { dg-message "" } forward ref struct Y { diff --git a/gcc/testsuite/g++.old-deja/g++.other/enum2.C b/gcc/testsuite/g++.old-deja/g++.other/enum2.C index 40328bfc..7fc269d 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/enum2.C +++ b/gcc/testsuite/g++.old-deja/g++.other/enum2.C @@ -5,7 +5,7 @@ // We'd like the enum location to be its identifier. -enum thing // { dg-error "" } previous def +enum thing // { dg-message "" } previous def { val1 }; diff --git a/gcc/testsuite/g++.old-deja/g++.other/incomplete.C b/gcc/testsuite/g++.old-deja/g++.other/incomplete.C index a00ea1c..7f0bc94 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/incomplete.C +++ b/gcc/testsuite/g++.old-deja/g++.other/incomplete.C @@ -4,7 +4,7 @@ // a void parm. We need to distinguish between a parmlist of (void), and // some ill-formed ones. -struct S; // { dg-error "" } forward ref +struct S; // { dg-message "" } forward ref void f(S); // ok void f(S s) {} // { dg-error "" } incomplete type diff --git a/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C index 3408a18..134a89c 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C +++ b/gcc/testsuite/g++.old-deja/g++.other/vaarg3.C @@ -10,7 +10,7 @@ struct X {int m;}; struct Y { Y(const Y&); }; -struct Z; // { dg-error "forward decl" } +struct Z; // { dg-message "forward decl" } void fn1(va_list args) { int i = va_arg (args, int); diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash9.C b/gcc/testsuite/g++.old-deja/g++.pt/crash9.C index aecbd60..f54d638 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/crash9.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash9.C @@ -3,7 +3,7 @@ template <class T> void f(T) {} // { dg-message "initializing" } -class C; // { dg-error "forward declaration" } +class C; // { dg-message "forward declaration" } void g(const C& c) { diff --git a/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C b/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C index 8476514..3130d32 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C @@ -1,7 +1,7 @@ // { dg-do assemble } // { dg-options "-fshow-column" } -struct A { // { dg-error "" } forward declaration +struct A { // { dg-message "" } forward declaration friend struct B : A { // { dg-error "invalid use of incomplete type 'struct A" "invalid" } int x; }; // { dg-error "class definition may not be declared a friend" "may not" { target *-*-* } { 5 } } diff --git a/gcc/testsuite/g++.old-deja/g++.pt/typename8.C b/gcc/testsuite/g++.old-deja/g++.pt/typename8.C index 4861cf3..581d6ce 100644 --- a/gcc/testsuite/g++.old-deja/g++.pt/typename8.C +++ b/gcc/testsuite/g++.old-deja/g++.pt/typename8.C @@ -17,7 +17,7 @@ public: } }; -class B : public A< B > // { dg-error "" } forward declaration +class B : public A< B > // { dg-message "" } forward declaration { public: typedef int myT; diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C index 41fed6f..cecf0aa 100644 --- a/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C +++ b/gcc/testsuite/g++.old-deja/g++.robertl/ice990323-1.C @@ -4,6 +4,6 @@ struct A {}; void f() { - struct A; // { dg-error "" } forward ref + struct A; // { dg-message "" } forward ref throw *(new A); // { dg-error "" } invalid use of undefined type } |