diff options
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/IntrusiveRefCntPtrTest.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/unittests/ADT/IntrusiveRefCntPtrTest.cpp b/unittests/ADT/IntrusiveRefCntPtrTest.cpp index 0c8c4ca..a74e05e 100644 --- a/unittests/ADT/IntrusiveRefCntPtrTest.cpp +++ b/unittests/ADT/IntrusiveRefCntPtrTest.cpp @@ -13,9 +13,12 @@ namespace llvm { struct VirtualRefCounted : public RefCountedBaseVPTR { - virtual void f() {} + virtual void f(); }; +// Provide out-of-line definition to prevent weak vtable. +void VirtualRefCounted::f() {} + // Run this test with valgrind to detect memory leaks. TEST(IntrusiveRefCntPtr, RefCountedBaseVPTRCopyDoesNotLeak) { VirtualRefCounted *V1 = new VirtualRefCounted; |