summaryrefslogtreecommitdiff
path: root/test/CXX/dcl.dcl/basic.namespace
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-03-31 01:36:47 +0000
committerJohn McCall <rjmccall@apple.com>2010-03-31 01:36:47 +0000
commit32daa4223ccb2c0afe5fbe151c6eb1ab64816957 (patch)
treeea565616681929a8a328883ce4d14ce0d48389f5 /test/CXX/dcl.dcl/basic.namespace
parent198bcb44b6271c92fd856403f34b518828100aac (diff)
downloadclang-32daa4223ccb2c0afe5fbe151c6eb1ab64816957.tar.gz
Regularize support for naming conversion functions in using decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99979 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX/dcl.dcl/basic.namespace')
-rw-r--r--test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
index 935f576788..89e9c897d2 100644
--- a/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
+++ b/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -faccess-control -verify %s
// We have to avoid ADL for this test.
@@ -65,3 +65,44 @@ namespace Test1 {
b _2 = B::b();
}
}
+
+namespace test2 {
+ class A {
+ protected:
+ operator int();
+ operator bool();
+ };
+
+ class B : private A {
+ protected:
+ using A::operator int; // expected-note {{'declared protected here'}}
+ public:
+ using A::operator bool;
+ };
+
+ int test() {
+ bool b = B();
+ return B(); // expected-error {{'operator int' is a protected member of 'test2::B'}}
+ }
+}
+
+namespace test3 {
+ class A {
+ ~A();
+ };
+
+ class B {
+ friend class C;
+ private:
+ operator A*();
+ };
+
+ class C : public B {
+ public:
+ using B::operator A*;
+ };
+
+ void test() {
+ delete C();
+ }
+}