summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-04-15 08:02:29 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-04-15 08:02:29 +0000
commit4eeaafcdeff3c6486c64d3568c2f413d9ff26046 (patch)
tree3d10eec633ae794bcb263a89fb90293d05c53014 /llvm
parentaad475b3241bdbbb38e0cf7dd637209b49d5d927 (diff)
downloadbcm5719-llvm-4eeaafcdeff3c6486c64d3568c2f413d9ff26046.tar.gz
bcm5719-llvm-4eeaafcdeff3c6486c64d3568c2f413d9ff26046.zip
[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... llvm-svn: 206256
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Allocator.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index d96c8f254cc..034661f4bcd 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/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));
}
OpenPOWER on IntegriCloud