diff --git a/include/llvm/Support/Allocator.h b/include/llvm/Support/Allocator.h index a28080187b6..5eccbccbfc2 100644 --- a/include/llvm/Support/Allocator.h +++ b/include/llvm/Support/Allocator.h @@ -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( &AllocatorBase::Allocate) != static_cast( &DerivedT::Allocate), "Class derives from AllocatorBase without implementing the " "core Allocate(size_t, size_t) overload!"); +#endif return static_cast(this)->Allocate(Size, Alignment); }