summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-23 00:37:40 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-23 00:37:40 +0000
commit0a4bb26ed03dc36ebbc68b1e5da498ddc8ba4f3c (patch)
treec5928e1251396cc69e647db9ae960ac03237c97f /clang/test
parent31e39bd3d47cbfa6d2c99ee1ad7bdabbc648117d (diff)
downloadbcm5719-llvm-0a4bb26ed03dc36ebbc68b1e5da498ddc8ba4f3c.tar.gz
bcm5719-llvm-0a4bb26ed03dc36ebbc68b1e5da498ddc8ba4f3c.zip
Set a member's access specifier even if it doesn't match the previous specifier.
Prevents an assert on successive redeclarations. Fixed PR5573. llvm-svn: 91956
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaCXX/access.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/access.cpp b/clang/test/SemaCXX/access.cpp
index ae2fef11f81..6115ff6a94f 100644
--- a/clang/test/SemaCXX/access.cpp
+++ b/clang/test/SemaCXX/access.cpp
@@ -21,3 +21,14 @@ protected:
private:
template<typename T> struct A {}; // expected-error {{'A' redeclared with 'private' access}}
};
+
+// PR5573
+namespace test1 {
+ class A {
+ private:
+ class X; // expected-note {{previously declared 'private' here}}
+ public:
+ class X; // expected-error {{ 'X' redeclared with 'public' access}}
+ class X {};
+ };
+}
OpenPOWER on IntegriCloud