1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 3 class C { 4 struct S; // expected-note {{previously declared 'private' here}} 5 public: 6 7 struct S {}; // expected-error {{'S' redeclared with 'public' access}} 8 }; 9 10 struct S { 11 class C; // expected-note {{previously declared 'public' here}} 12 13 private: 14 class C { }; // expected-error {{'C' redeclared with 'private' access}} 15 }; 16 17 class T { 18 protected: 19 template<typename T> struct A; // expected-note {{previously declared 'protected' here}} 20 21 private: 22 template<typename T> struct A {}; // expected-error {{'A' redeclared with 'private' access}} 23 }; 24 25 // PR5573 26 namespace test1 { 27 class A { 28 private: 29 class X; // expected-note {{previously declared 'private' here}} 30 public: 31 class X; // expected-error {{'X' redeclared with 'public' access}} 32 class X {}; 33 }; 34 } 35