diff options
Diffstat (limited to 'test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp')
-rw-r--r-- | test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp b/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp index ade6198..e69a81b 100644 --- a/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp +++ b/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp @@ -1,7 +1,7 @@ // RUN: %clang_cc1 %s -fsyntax-only -verify struct A { - A() { f(); } // expected-warning {{call to pure virtual member function 'f'; overrides of 'f' in subclasses are not available in the constructor of 'A'}} - ~A() { f(); } // expected-warning {{call to pure virtual member function 'f'; overrides of 'f' in subclasses are not available in the destructor of 'A'}} + A() { f(); } // expected-warning {{call to pure virtual member function 'f' has undefined behavior; overrides of 'f' in subclasses are not available in the constructor of 'A'}} + ~A() { f(); } // expected-warning {{call to pure virtual member function 'f' has undefined behavior; overrides of 'f' in subclasses are not available in the destructor of 'A'}} virtual void f() = 0; // expected-note 2 {{'f' declared here}} }; @@ -12,3 +12,11 @@ struct B { B() { a->f(); }; ~B() { a->f(); }; }; + +// Don't warn if the call is fully qualified. (PR23215) +struct C { + virtual void f() = 0; + C() { + C::f(); + } +}; |