summaryrefslogtreecommitdiffstats
path: root/test/Analysis/virtualcall.h
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/virtualcall.h')
-rw-r--r--test/Analysis/virtualcall.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/Analysis/virtualcall.h b/test/Analysis/virtualcall.h
new file mode 100644
index 0000000..9f7094d
--- /dev/null
+++ b/test/Analysis/virtualcall.h
@@ -0,0 +1,28 @@
+#ifdef AS_SYSTEM
+#pragma clang system_header
+
+namespace system {
+ class A {
+ public:
+ A() {
+ foo(); // no-warning
+ }
+
+ virtual int foo();
+ };
+}
+
+#else
+
+namespace header {
+ class A {
+ public:
+ A() {
+ foo(); // expected-warning{{Call virtual functions during construction or destruction will never go to a more derived class}}
+ }
+
+ virtual int foo();
+ };
+}
+
+#endif
OpenPOWER on IntegriCloud