aboutsummaryrefslogtreecommitdiffstats
path: root/test/Analysis/virtualcall.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/virtualcall.cpp')
-rw-r--r--test/Analysis/virtualcall.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Analysis/virtualcall.cpp b/test/Analysis/virtualcall.cpp
index e42b898a0738..311f0a137c6f 100644
--- a/test/Analysis/virtualcall.cpp
+++ b/test/Analysis/virtualcall.cpp
@@ -115,12 +115,23 @@ public:
int foo() override;
};
+// Regression test: don't crash when there's no direct callee.
+class F {
+public:
+ F() {
+ void (F::* ptr)() = &F::foo;
+ (this->*ptr)();
+ }
+ void foo();
+};
+
int main() {
A *a;
B *b;
C *c;
D *d;
E *e;
+ F *f;
}
#include "virtualcall.h"