Fix some Wundef warnings in Compiler.h

Check for definedness of the __cpp_sized_deallocation and
__cpp_aligned_new feature test macros.  These will not be defined
when the feature is not available, and that prevents any code that
includes this header from compiling with -Wundef -Werror.

Differential Revision: https://reviews.llvm.org/D51171

llvm-svn: 341364
This commit is contained in:
Sven van Haastregt 2018-09-04 12:46:21 +00:00
parent 664aa868f5
commit 9a5cd78e7e
1 changed files with 3 additions and 3 deletions

View File

@ -519,7 +519,7 @@ namespace llvm {
/// reduced default alignment.
inline void *allocate_buffer(size_t Size, size_t Alignment) {
return ::operator new(Size
#if __cpp_aligned_new
#ifdef __cpp_aligned_new
,
std::align_val_t(Alignment)
#endif
@ -535,11 +535,11 @@ inline void *allocate_buffer(size_t Size, size_t Alignment) {
/// most likely using the above helper.
inline void deallocate_buffer(void *Ptr, size_t Size, size_t Alignment) {
::operator delete(Ptr
#if __cpp_sized_deallocation
#ifdef __cpp_sized_deallocation
,
Size
#endif
#if __cpp_aligned_new
#ifdef __cpp_aligned_new
,
std::align_val_t(Alignment)
#endif