summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp
diff options
context:
space:
mode:
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.cpp7
1 files changed, 7 insertions, 0 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
new file mode 100644
index 0000000..698eccd
--- /dev/null
+++ b/test/SemaCXX/warn-pure-virtual-call-from-ctor-dtor.cpp
@@ -0,0 +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'}}
+
+ virtual void f() = 0; // expected-note 2 {{'f' declared here}}
+};
OpenPOWER on IntegriCloud