diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-11-19 06:35:35 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-11-19 06:35:35 +0000 |
commit | 9d7c776d32c8a4d64b37a91c2d627629cf1498ef (patch) | |
tree | 92f96f6c5615bd64c6f734f1534a7aa29a47c67a /unittests/ADT | |
parent | db56a39b56db896a1043f3c2b6e5baf82d28cb0e (diff) | |
download | external_llvm-9d7c776d32c8a4d64b37a91c2d627629cf1498ef.zip external_llvm-9d7c776d32c8a4d64b37a91c2d627629cf1498ef.tar.gz external_llvm-9d7c776d32c8a4d64b37a91c2d627629cf1498ef.tar.bz2 |
Merging r195092:
------------------------------------------------------------------------
r195092 | ributzka | 2013-11-18 19:08:35 -0800 (Mon, 18 Nov 2013) | 5 lines
[weak vtables] Place class definitions into anonymous namespaces to prevent weak vtables.
This patch places class definitions in implementation files into anonymous
namespaces to prevent weak vtables. This eliminates the need of providing an
out-of-line definition to pin the vtable explicitly to the file.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/ADT')
-rw-r--r-- | unittests/ADT/IntrusiveRefCntPtrTest.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/unittests/ADT/IntrusiveRefCntPtrTest.cpp b/unittests/ADT/IntrusiveRefCntPtrTest.cpp index a74e05e..c67ec13 100644 --- a/unittests/ADT/IntrusiveRefCntPtrTest.cpp +++ b/unittests/ADT/IntrusiveRefCntPtrTest.cpp @@ -10,14 +10,13 @@ #include "llvm/ADT/IntrusiveRefCntPtr.h" #include "gtest/gtest.h" -namespace llvm { - -struct VirtualRefCounted : public RefCountedBaseVPTR { - virtual void f(); +namespace { +struct VirtualRefCounted : public llvm::RefCountedBaseVPTR { + virtual void f() {} }; +} -// Provide out-of-line definition to prevent weak vtable. -void VirtualRefCounted::f() {} +namespace llvm { // Run this test with valgrind to detect memory leaks. TEST(IntrusiveRefCntPtr, RefCountedBaseVPTRCopyDoesNotLeak) { |