diff options
Diffstat (limited to 'clang/test/CodeGenCXX/vtable-layout.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/vtable-layout.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/vtable-layout.cpp b/clang/test/CodeGenCXX/vtable-layout.cpp index f7db2135d2f..6cc1b0b691e 100644 --- a/clang/test/CodeGenCXX/vtable-layout.cpp +++ b/clang/test/CodeGenCXX/vtable-layout.cpp @@ -113,3 +113,13 @@ struct D : B { void D::f() { } } + +// For now, just verify this doesn't crash. +namespace test0 { + struct Obj {}; + + struct Base { virtual const Obj *foo() = 0; }; + struct Derived : Base { virtual Obj *foo() { return new Obj(); } }; + + void test(Derived *D) { D->foo(); } +} |