diff options
| author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-09-04 12:46:21 +0000 |
|---|---|---|
| committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-09-04 12:46:21 +0000 |
| commit | 9a5cd78e7e39a398cf4d25e07a27d33678ec597e (patch) | |
| tree | 090a09326824ef5681fee0bf8a01a4020939821e /llvm | |
| parent | 664aa868f57119e06dd56ad90625219ad1bb973a (diff) | |
| download | bcm5719-llvm-9a5cd78e7e39a398cf4d25e07a27d33678ec597e.tar.gz bcm5719-llvm-9a5cd78e7e39a398cf4d25e07a27d33678ec597e.zip | |
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
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/Compiler.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/Compiler.h b/llvm/include/llvm/Support/Compiler.h index 4de815fe61d..9783c67ae32 100644 --- a/llvm/include/llvm/Support/Compiler.h +++ b/llvm/include/llvm/Support/Compiler.h @@ -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 |

