[cfe-commits] r74051 - /cfe/trunk/test/CXX/class/class.local/p2.cpp
Anders Carlsson
andersca at mac.com
Tue Jun 23 19:00:28 PDT 2009
Author: andersca
Date: Tue Jun 23 21:00:28 2009
New Revision: 74051
URL: http://llvm.org/viewvc/llvm-project?rev=74051&view=rev
Log:
Add test for [class.local]p2.
Added:
cfe/trunk/test/CXX/class/class.local/p2.cpp
Added: cfe/trunk/test/CXX/class/class.local/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.local/p2.cpp?rev=74051&view=auto
==============================================================================
--- cfe/trunk/test/CXX/class/class.local/p2.cpp (added)
+++ cfe/trunk/test/CXX/class/class.local/p2.cpp Tue Jun 23 21:00:28 2009
@@ -0,0 +1,12 @@
+// RUN: clang-cc -fsyntax-only -verify %s -faccess-control
+
+struct A { };
+
+void f() {
+ struct B : private A {}; // expected-note{{'private' inheritance specifier here}}
+
+ B b;
+
+ A *a = &b; // expected-error{{conversion from 'struct B' to inaccessible base class 'struct A'}} \
+ expected-error{{incompatible type initializing 'struct B *', expected 'struct A *'}}
+}
More information about the cfe-commits
mailing list