diff options
Diffstat (limited to 'test/CXX/class.access/p6.cpp')
-rw-r--r-- | test/CXX/class.access/p6.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CXX/class.access/p6.cpp b/test/CXX/class.access/p6.cpp index fe3304a22253..932b4f42f2a3 100644 --- a/test/CXX/class.access/p6.cpp +++ b/test/CXX/class.access/p6.cpp @@ -168,3 +168,25 @@ namespace test7 { void foo(int arg[__builtin_offsetof(B, ins)]); } } + +// rdar://problem/10155256 +namespace test8 { + class A { + typedef void* (A::*UnspecifiedBoolType)() const; + operator UnspecifiedBoolType() const; // expected-note {{implicitly declared private here}} + }; + + void test(A &a) { + if (a) return; // expected-error {{'operator void *(class test8::A::*)(void) const' is a private member of 'test8::A'}} + } +} + +namespace test9 { + class A { + operator char*() const; // expected-note {{implicitly declared private here}} + }; + + void test(A &a) { + delete a; // expected-error {{'operator char *' is a private member of 'test9::A'}} + } +} |