diff options
Diffstat (limited to 'test/CXX/class.derived/class.abstract/p16.cpp')
-rw-r--r-- | test/CXX/class.derived/class.abstract/p16.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/CXX/class.derived/class.abstract/p16.cpp b/test/CXX/class.derived/class.abstract/p16.cpp new file mode 100644 index 0000000..93f905c --- /dev/null +++ b/test/CXX/class.derived/class.abstract/p16.cpp @@ -0,0 +1,16 @@ +// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s + +struct A { + virtual void a(); // expected-note{{overridden virtual function is here}} + virtual void b() = delete; // expected-note{{overridden virtual function is here}} +}; + +struct B: A { + virtual void a() = delete; // expected-error{{deleted function 'a' cannot override a non-deleted function}} + virtual void b(); // expected-error{{non-deleted function 'b' cannot override a deleted function}} +}; + +struct C: A { + virtual void a(); + virtual void b() = delete; +}; |