[ADT] Attempt to fix GCC warning in IntrusiveRefCntPtrTest.

Our copy constructor doesn't explicitly invoke the base class's
constructor, and GCC is (rightly) concerned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291023 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Justin Lebar 2017-01-04 22:49:55 +00:00
parent 6c6903a8c4
commit d5845b6d12

View File

@ -15,7 +15,9 @@ namespace llvm {
namespace {
struct SimpleRefCounted : public RefCountedBase<SimpleRefCounted> {
SimpleRefCounted() { ++NumInstances; }
SimpleRefCounted(const SimpleRefCounted &) { ++NumInstances; }
SimpleRefCounted(const SimpleRefCounted &) : RefCountedBase() {
++NumInstances;
}
~SimpleRefCounted() { --NumInstances; }
static int NumInstances;