From f18f4cc6dbee29990c4b4f89188548090a93341e Mon Sep 17 00:00:00 2001 From: Kamil Rytarowski Date: Sat, 6 Feb 2016 03:16:55 +0100 Subject: [PATCH] Fix NetBSD build: Define virtual destructors when needed This fixes the following error with recent Clang (3.9.0nb20160205): In file included from /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/synchmgr/synchcontrollers.cpp:20: In file included from /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/synchmgr/synchmanager.hpp:24: /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/include/pal/synchcache.hpp:146:13: error: destructor called on non-final 'CorUnix::CSynchWaitController' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] pobj->~T(); ^ /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/synchmgr/synchmanager.hpp:724:31: note: in instantiation of member function 'CorUnix::CSynchCache::Add' requested here m_cacheWaitCtrlrs.Add(pthrCurrent, pCtrlr); ^ /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/include/pal/synchcache.hpp:146:20: note: qualify call to silence this warning pobj->~T(); ^ CorUnix::CSynchWaitController:: /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/include/pal/synchcache.hpp:146:13: error: destructor called on non-final 'CorUnix::CSynchStateController' that has virtual functions but non-virtual destructor [-Werror,-Wdelete-non-virtual-dtor] pobj->~T(); ^ /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/synchmgr/synchmanager.hpp:741:32: note: in instantiation of member function 'CorUnix::CSynchCache::Add' requested here m_cacheStateCtrlrs.Add(pthrCurrent, pCtrlr); ^ /tmp/pkgsrc-tmp/wip/coreclr-git/work/coreclr/src/pal/src/include/pal/synchcache.hpp:146:20: note: qualify call to silence this warning pobj->~T(); ^ CorUnix::CSynchStateController:: 2 errors generated. --- src/pal/src/synchmgr/synchmanager.hpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pal/src/synchmgr/synchmanager.hpp b/src/pal/src/synchmgr/synchmanager.hpp index b41c347f37..91a2da02cc 100644 --- a/src/pal/src/synchmgr/synchmanager.hpp +++ b/src/pal/src/synchmgr/synchmanager.hpp @@ -452,6 +452,7 @@ namespace CorUnix public: CSynchWaitController() : m_pProcLocalData(NULL) {} + virtual ~CSynchWaitController() = default; // // ISynchWaitController methods @@ -479,8 +480,9 @@ namespace CorUnix { public: // NB: For perforformance purposes this class is supposed - // to have no constructor or destructor - + // to have no constructor + virtual ~CSynchStateController() = default; + // // ISynchStateController methods // @@ -1021,4 +1023,3 @@ namespace CorUnix } #endif // _SINCHMANAGER_HPP_ - -- 2.34.1