summaryrefslogtreecommitdiff
path: root/clang/test/CXX/class/class.local/p2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CXX/class/class.local/p2.cpp')
-rw-r--r--clang/test/CXX/class/class.local/p2.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CXX/class/class.local/p2.cpp b/clang/test/CXX/class/class.local/p2.cpp
new file mode 100644
index 0000000..db4c90f
--- /dev/null
+++ b/clang/test/CXX/class/class.local/p2.cpp
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+struct A { };
+
+void f() {
+ struct B : private A {}; // expected-note{{declared private here}}
+
+ B b;
+
+ A *a = &b; // expected-error{{cannot cast 'B' to its private base class 'A'}}
+}