diff options
Diffstat (limited to 'clang/test/SemaCXX/abstract.cpp')
-rw-r--r-- | clang/test/SemaCXX/abstract.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/abstract.cpp b/clang/test/SemaCXX/abstract.cpp index 1c5b715775d..d7e2d0a3dcf 100644 --- a/clang/test/SemaCXX/abstract.cpp +++ b/clang/test/SemaCXX/abstract.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wabstract-vbase-init #ifndef __GXX_EXPERIMENTAL_CXX0X__ #define __CONCAT(__X, __Y) __CONCAT1(__X, __Y) @@ -280,3 +280,30 @@ namespace pr12658 { foo(C(99)); // expected-error {{allocating an object of abstract class type 'pr12658::C'}}
} } + +namespace pr16659 { + struct A { + A(int); + virtual void x() = 0; // expected-note {{unimplemented pure virtual method 'x' in 'RedundantInit'}} + }; + struct B : virtual A {}; + struct C : B { + C() : A(37) {} + void x() override {} + }; + + struct X { + friend class Z; + private: + X &operator=(const X&); + }; + struct Y : virtual X { // expected-note {{::X' has an inaccessible copy assignment}} + virtual ~Y() = 0; + }; + struct Z : Y {}; // expected-note {{::Y' has a deleted copy assignment}} + void f(Z &a, const Z &b) { a = b; } // expected-error {{copy assignment operator is implicitly deleted}} + + struct RedundantInit : virtual A { + RedundantInit() : A(0) {} // expected-warning {{initializer for virtual base class 'pr16659::A' of abstract class 'RedundantInit' will never be used}} + }; +} |