diff options
Diffstat (limited to 'test/CXX/expr/expr.unary/expr.delete/p5.cpp')
-rw-r--r-- | test/CXX/expr/expr.unary/expr.delete/p5.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/test/CXX/expr/expr.unary/expr.delete/p5.cpp b/test/CXX/expr/expr.unary/expr.delete/p5.cpp index 2fa30e5..ecb2918 100644 --- a/test/CXX/expr/expr.unary/expr.delete/p5.cpp +++ b/test/CXX/expr/expr.unary/expr.delete/p5.cpp @@ -24,11 +24,23 @@ void f0(T2_A *a) { T2_C x; x.f0(a); } class T2_A { }; // An alternate version of the same. -// -// FIXME: Revisit this case when we have access control. class T3_A; template<typename T> -struct T3_B { void f0(T *a) { delete a; } }; -struct T3_C { T3_B<T3_A> x; void f0(T3_A *a) { x.f0(a); } }; +struct T3_B { + void f0(T *a) { + delete a; // expected-error{{calling a private destructor of class 'T3_A'}} + } +}; + +struct T3_C { + T3_B<T3_A> x; + void f0(T3_A *a) { + x.f0(a); // expected-note{{in instantiation of member function 'T3_B<T3_A>::f0' requested here}} + } +}; + void f0(T3_A *a) { T3_C x; x.f0(a); } -class T3_A { private: ~T3_A(); }; +class T3_A { +private: + ~T3_A(); // expected-note{{declared private here}} +}; |