summaryrefslogtreecommitdiffstats
path: root/test/SemaCXX/warn-pure-virtual-kext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/warn-pure-virtual-kext.cpp')
-rw-r--r--test/SemaCXX/warn-pure-virtual-kext.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-pure-virtual-kext.cpp b/test/SemaCXX/warn-pure-virtual-kext.cpp
new file mode 100644
index 0000000..e681a02
--- /dev/null
+++ b/test/SemaCXX/warn-pure-virtual-kext.cpp
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 %s -fapple-kext -fsyntax-only -verify
+
+struct A {
+ virtual void f() = 0; // expected-note {{'f' declared here}}
+ 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'}} // expected-note {{qualified call to 'A'::'f' is treated as a virtual call to 'f' due to -fapple-kext}}
+ }
+};
OpenPOWER on IntegriCloud