opnsense-src/test/CXX/class/class.local/p2.cpp

12 lines
266 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -fsyntax-only -verify %s -faccess-control
2009-06-27 06:45:02 -04:00
struct A { };
void f() {
2010-02-16 04:31:36 -05:00
struct B : private A {}; // expected-note{{declared private here}}
2009-06-27 06:45:02 -04:00
B b;
2010-02-16 04:31:36 -05:00
A *a = &b; // expected-error{{cannot cast 'struct B' to its private base class 'struct A'}}
2009-06-27 06:45:02 -04:00
}