Check that the access specifier of a member redeclaration is the same as the original declaration.
llvm-svn: 67722
diff --git a/clang/test/SemaCXX/access.cpp b/clang/test/SemaCXX/access.cpp
new file mode 100644
index 0000000..d95781c
--- /dev/null
+++ b/clang/test/SemaCXX/access.cpp
@@ -0,0 +1,15 @@
+// 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}}
+};
\ No newline at end of file