diff options
Diffstat (limited to 'test/SemaCXX/access.cpp')
-rw-r--r-- | test/SemaCXX/access.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaCXX/access.cpp b/test/SemaCXX/access.cpp new file mode 100644 index 000000000000..cfbc9c80692b --- /dev/null +++ b/test/SemaCXX/access.cpp @@ -0,0 +1,23 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +class C { + struct S; // expected-note {{previously declared 'private' here}} +public: + + struct S {}; // expected-error {{'S' redeclared with 'public' access}} +}; + +struct S { + class C; // expected-note {{previously declared 'public' here}} + +private: + class C { }; // expected-error {{'C' redeclared with 'private' access}} +}; + +class T { +protected: + template<typename T> struct A; // expected-note {{previously declared 'protected' here}} + +private: + template<typename T> struct A {}; // expected-error {{'A' redeclared with 'private' access}} +}; |