diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2014-04-15 08:02:29 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2014-04-15 08:02:29 +0000 |
commit | 2c9a974b2b7f40205960a91b1dd10d58510de992 (patch) | |
tree | 133341e1def21486e25cffa9779e302ca325637a /include/llvm/Support/Allocator.h | |
parent | d63390cba15f10600d550201f2e9109e75933a0f (diff) | |
download | llvm-2c9a974b2b7f40205960a91b1dd10d58510de992.tar.gz llvm-2c9a974b2b7f40205960a91b1dd10d58510de992.tar.bz2 llvm-2c9a974b2b7f40205960a91b1dd10d58510de992.tar.xz |
[Allocator] MSVC apparantly has broken SFINAE context handling of
'sizeof(T)' for T == void and produces a hard error. I cannot fathom why
this is OK. Oh well. switch to an explicit test for being the
(potentially qualified) void type, which is the only specific case I was
worried about. Hopefully this survives the libstdc++ build bots which
have limited type traits implementations...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Allocator.h')
-rw-r--r-- | include/llvm/Support/Allocator.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index d96c8f254c..034661f4bc 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -98,13 +98,16 @@ public: /// \brief Deallocate space for one object without destroying it. template <typename T> - typename std::enable_if<sizeof(T) != 0, void>::type Deallocate(T *Ptr) { + typename std::enable_if< + std::is_same<typename std::remove_cv<T>::type, void>::value, void>::type + Deallocate(T *Ptr) { Deallocate(static_cast<const void *>(Ptr)); } /// \brief Allocate space for an array of objects without constructing them. template <typename T> - typename std::enable_if<sizeof(T) != 0, void>::type + typename std::enable_if< + std::is_same<typename std::remove_cv<T>::type, void>::value, void>::type Deallocate(T *Ptr, size_t /*Num*/) { Deallocate(static_cast<const void *>(Ptr)); } |