From b40eac41b528d3ec668ba7032d590684100d1488 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sat, 21 Mar 2020 21:24:57 -0700 Subject: Fixed latest MSVC (19.25.28610.4) build issue --- Common/interface/RefCountedObjectImpl.hpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'Common/interface') diff --git a/Common/interface/RefCountedObjectImpl.hpp b/Common/interface/RefCountedObjectImpl.hpp index 5ce5453f..c437f170 100644 --- a/Common/interface/RefCountedObjectImpl.hpp +++ b/Common/interface/RefCountedObjectImpl.hpp @@ -469,7 +469,15 @@ private: RefCountersImpl& operator = (RefCountersImpl&&) = delete; // clang-format on - static constexpr size_t ObjectWrapperBufferSize = sizeof(ObjectWrapper) / sizeof(size_t); + struct IObjectStub : public IObject + { + virtual ~IObjectStub() = 0; + }; + // MSVC starting with 19.25.28610.4 fails to compile sizeof(ObjectWrapper) because + // IObject does not have virtual destructor. The compiler is technically right, so we use IObjectStub, + // which does have virtual destructor. + static constexpr size_t ObjectWrapperBufferSize = sizeof(ObjectWrapper) / sizeof(size_t); + size_t m_ObjectWrapperBuffer[ObjectWrapperBufferSize]; Atomics::AtomicLong m_lNumStrongReferences; Atomics::AtomicLong m_lNumWeakReferences; -- cgit v1.2.3