From 2c9a974b2b7f40205960a91b1dd10d58510de992 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Tue, 15 Apr 2014 08:02:29 +0000 Subject: [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 --- include/llvm/Support/Allocator.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/llvm/Support/Allocator.h') 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 std::enable_if::type Deallocate(T *Ptr) { + typename std::enable_if< + std::is_same::type, void>::value, void>::type + Deallocate(T *Ptr) { Deallocate(static_cast(Ptr)); } /// \brief Allocate space for an array of objects without constructing them. template - typename std::enable_if::type + typename std::enable_if< + std::is_same::type, void>::value, void>::type Deallocate(T *Ptr, size_t /*Num*/) { Deallocate(static_cast(Ptr)); } -- cgit v1.2.3