// RUN: %clang_cc1 -fsyntax-only -verify %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s class A {}; // expected-note 4 {{previous use is here}} enum E {}; void a1(struct A); void a2(class A); void a3(union A); // expected-error {{use of 'A' with tag type that does not match previous declaration}} void a4(enum A); // expected-error {{use of 'A' with tag type that does not match previous declaration}} class A1 { friend struct A; friend class A; friend union A; // expected-error {{use of 'A' with tag type that does not match previous declaration}} friend enum A; // expected-error {{use of 'A' with tag type that does not match previous declaration}} friend enum E; #if __cplusplus <= 199711L // C++03 or earlier modes // expected-warning@-2 {{befriending enumeration type 'enum E' is a C++11 extension}} #endif }; template struct B { // expected-note {{previous use is here}} class Member {}; // expected-note 2 {{previous use is here}} }; template <> class B { // no type Member }; template <> struct B { union Member { // expected-note 4 {{previous use is here}} void* a; }; }; void b1(struct B); void b2(class B); void b3(union B); // expected-error {{use of 'B' with tag type that does not match previous declaration}} //void b4(enum B); // this just doesn't parse; you can't template an enum directly void c1(struct B::Member); void c2(class B::Member); void c3(union B::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}} void c4(enum B::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}} void d1(struct B::Member); // expected-error {{no struct named 'Member' in 'B'}} void d2(class B::Member); // expected-error {{no class named 'Member' in 'B'}} void d3(union B::Member); // expected-error {{no union named 'Member' in 'B'}} void d4(enum B::Member); // expected-error {{no enum named 'Member' in 'B'}} void e1(struct B::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}} void e2(class B::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}} void e3(union B::Member); void e4(enum B::Member); // expected-error {{use of 'Member' with tag type that does not match previous declaration}} template struct C { void foo(class B::Member); // expected-error{{no class named 'Member' in 'B'}} \ // expected-error{{use of 'Member' with tag type that does not match previous declaration}} }; C f1; C f2; // expected-note {{in instantiation of template class}} C f3; // expected-note {{in instantiation of template class}}