From 36c49e3f258dced101949edabd72e9bc3f1dedc4 Mon Sep 17 00:00:00 2001 From: dim Date: Fri, 17 Sep 2010 15:54:40 +0000 Subject: Vendor import of clang r114020 (from the release_28 branch): http://llvm.org/svn/llvm-project/cfe/branches/release_28@114020 Approved by: rpaulo (mentor) --- test/CXX/class.access/p4.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'test/CXX/class.access/p4.cpp') diff --git a/test/CXX/class.access/p4.cpp b/test/CXX/class.access/p4.cpp index 90a1449..115a22a 100644 --- a/test/CXX/class.access/p4.cpp +++ b/test/CXX/class.access/p4.cpp @@ -372,7 +372,7 @@ namespace test15 { int private_foo; // expected-note {{declared private here}} static int private_sfoo; // expected-note {{declared private here}} protected: - int protected_foo; // expected-note 4 {{declared protected here}} + int protected_foo; // expected-note 3 {{declared protected here}} // expected-note {{object type must derive from context type 'test15::B'}} static int protected_sfoo; // expected-note 3 {{declared protected here}} int test1(A &a) { @@ -427,3 +427,26 @@ namespace test16 { void b() { throw A(); } // expected-error{{temporary of type 'test16::A' has private destructor}} \ // expected-error{{exception object of type 'test16::A' has private destructor}} } + +// rdar://problem/8146294 +namespace test17 { + class A { + template class Inner { }; // expected-note {{declared private here}} + }; + + A::Inner s; // expected-error {{'Inner' is a private member of 'test17::A'}} +} + +namespace test18 { + template class A {}; + class B : A { + A member; + }; + + // FIXME: this access to A should be forbidden (because C++ is dumb), + // but LookupResult can't express the necessary information to do + // the check, so we aggressively suppress access control. + class C : B { + A member; + }; +} -- cgit v1.1