]> granicus.if.org Git - clang/commitdiff
Make this test check a few more cases which didn't work correctly before
authorEli Friedman <eli.friedman@gmail.com>
Sun, 8 Aug 2010 05:07:06 +0000 (05:07 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Sun, 8 Aug 2010 05:07:06 +0000 (05:07 +0000)
r110526.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110540 91177308-0d34-0410-b5e6-96231b3b80d8

test/SemaCXX/virtual-base-used.cpp

index c9e3d2f802b0d3995b2156a6b93b465ed09ddceb..d147b13f04fdf63d5ffa59afafe325f7d8b64245 100644 (file)
@@ -1,10 +1,11 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 // PR7800
 
-class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
+class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
 struct A {
   virtual ~A();
 };
+
 struct B : public virtual A {
   NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
 };
@@ -14,3 +15,28 @@ struct D : public virtual B {
 };
 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}}
+}