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
This commit is contained in:
parent
883755a164
commit
7fb80849cb
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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" }
|
||||
|
@ -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();
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
// { dg-options "-fpermissive -w" }
|
||||
|
||||
struct A; // { dg-error "" }
|
||||
struct A; // { dg-message "" }
|
||||
|
||||
struct B
|
||||
{
|
||||
|
@ -1,3 +1,3 @@
|
||||
struct S; // { dg-error "forward" }
|
||||
struct S; // { dg-message "forward" }
|
||||
|
||||
void f(S* p) { ((S) (*p)); } // { dg-error "" }
|
||||
|
@ -1,4 +1,4 @@
|
||||
class Foo; // { dg-error "" }
|
||||
class Foo; // { dg-message "" }
|
||||
|
||||
void
|
||||
bar(void* p)
|
||||
|
@ -1,7 +1,7 @@
|
||||
class A
|
||||
{ };
|
||||
|
||||
class B; // { dg-error "forward declaration" }
|
||||
class B; // { dg-message "forward declaration" }
|
||||
|
||||
union 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" }
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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" }
|
||||
|
@ -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 {};
|
||||
|
||||
|
@ -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" }
|
||||
|
@ -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" }
|
||||
|
@ -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" }
|
||||
|
@ -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 ()
|
||||
|
@ -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(
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
// PR c++/42057
|
||||
|
||||
struct A; // { dg-error "forward declaration" }
|
||||
struct A; // { dg-message "forward declaration" }
|
||||
|
||||
struct B
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
// PR c++/25856
|
||||
|
||||
struct A; // { dg-error "forward" }
|
||||
struct A; // { dg-message "forward" }
|
||||
A::~A() {} // { dg-error "incomplete" }
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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>&);
|
||||
|
@ -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() {
|
||||
|
@ -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" }
|
||||
{
|
||||
|
@ -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" }
|
||||
;
|
||||
|
||||
|
@ -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" }
|
||||
|
@ -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" }
|
||||
}
|
||||
|
||||
|
@ -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" }
|
||||
|
@ -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" }
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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" }
|
||||
{
|
||||
|
@ -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" }
|
||||
};
|
||||
|
||||
|
@ -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
|
||||
|
@ -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" }
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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" }
|
||||
|
@ -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" "" }
|
||||
|
||||
|
@ -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 ();
|
||||
|
@ -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 "" } .*
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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 } }
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user