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;