From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/SemaCXX/virtual-base-used.cpp | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 clang/test/SemaCXX/virtual-base-used.cpp (limited to 'clang/test/SemaCXX/virtual-base-used.cpp') diff --git a/clang/test/SemaCXX/virtual-base-used.cpp b/clang/test/SemaCXX/virtual-base-used.cpp new file mode 100644 index 0000000..d147b13 --- /dev/null +++ b/clang/test/SemaCXX/virtual-base-used.cpp @@ -0,0 +1,42 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s +// PR7800 + +class NoDestroy { ~NoDestroy(); }; // expected-note 3 {{declared private here}} +struct A { + virtual ~A(); +}; + +struct B : public virtual A { + NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} +}; +struct D : public virtual B { + virtual void foo(); + ~D(); +}; +void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}} +} + +struct E : public virtual A { + NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} +}; +struct F : public E { // expected-note {{implicit default destructor for 'E' first required here}} +}; +struct G : public virtual F { + virtual void foo(); + ~G(); +}; +void G::foo() { // expected-note {{implicit default destructor for 'F' first required here}} +} + +struct H : public virtual A { + NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}} +}; +struct I : public virtual H { + ~I(); +}; +struct J : public I { + virtual void foo(); + ~J(); +}; +void J::foo() { // expected-note {{implicit default destructor for 'H' first required here}} +} -- cgit v1.2.3