diff options
Diffstat (limited to 'clang/test/SemaCXX/access-member-pointer.cpp')
-rw-r--r-- | clang/test/SemaCXX/access-member-pointer.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/access-member-pointer.cpp b/clang/test/SemaCXX/access-member-pointer.cpp new file mode 100644 index 0000000..676eb10 --- /dev/null +++ b/clang/test/SemaCXX/access-member-pointer.cpp @@ -0,0 +1,11 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// PR7694 + +class A { }; +class B : private A { public: void foo(); }; // expected-note {{declared private here}} +void B::foo() { + (void)static_cast<void(A::*)()>(&B::foo); +} +void bar() { + (void)static_cast<void(A::*)()>(&B::foo); // expected-error {{cannot cast 'B' to its private base class 'A'}} +} |