[llvm] r206226 - [Allocator] Hack around the fact that GCC can't compile the
Chandler Carruth
chandlerc at gmail.com
Mon Apr 14 17:22:53 PDT 2014
Author: chandlerc
Date: Mon Apr 14 19:22:53 2014
New Revision: 206226
URL: http://llvm.org/viewvc/llvm-project?rev=206226&view=rev
Log:
[Allocator] Hack around the fact that GCC can't compile the
static_assert added in r206225. I'm looking into a proper fix, but
wanted the bots back.
Modified:
llvm/trunk/include/llvm/Support/Allocator.h
Modified: llvm/trunk/include/llvm/Support/Allocator.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Allocator.h?rev=206226&r1=206225&r2=206226&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Allocator.h (original)
+++ llvm/trunk/include/llvm/Support/Allocator.h Mon Apr 14 19:22:53 2014
@@ -50,12 +50,14 @@ public:
/// \brief Allocate \a Size bytes of \a Alignment aligned memory. This method
/// must be implemented by \c DerivedT.
void *Allocate(size_t Size, size_t Alignment) {
+#ifdef __clang__
static_assert(static_cast<void *(AllocatorBase::*)(size_t, size_t)>(
&AllocatorBase::Allocate) !=
static_cast<void *(DerivedT::*)(size_t, size_t)>(
&DerivedT::Allocate),
"Class derives from AllocatorBase without implementing the "
"core Allocate(size_t, size_t) overload!");
+#endif
return static_cast<DerivedT *>(this)->Allocate(Size, Alignment);
}
More information about the llvm-commits
mailing list