summaryrefslogtreecommitdiffstats
path: root/clang/test
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
commitda4458e98f54c009116cf4073e065d69fc99e186 (patch)
tree15754852a882f962f75f8508de5d857d85c5aeb6 /clang/test
parent034299ef25d3468319fa8d447b784501d7f7e25d (diff)
downloadbcm5719-llvm-da4458e98f54c009116cf4073e065d69fc99e186.tar.gz
bcm5719-llvm-da4458e98f54c009116cf4073e065d69fc99e186.zip
Regularize support for naming conversion functions in using decls.
llvm-svn: 99979
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp b/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
index 935f5767889..89e9c897d22 100644
--- a/clang/test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
+++ b/clang/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();
+ }
+}
OpenPOWER on IntegriCloud