Skip to content

Commit

Permalink
Use standard-conforming alignof in debugallocation.cc
Browse files Browse the repository at this point in the history
Clang was giving warning that alignof(<variable>) is extension. So
we're now doing alignof of decltype.
  • Loading branch information
alk committed Aug 6, 2018
1 parent 71c8ced commit c41688b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/debugallocation.cc
Expand Up @@ -1152,8 +1152,8 @@ static union {

REGISTER_MODULE_INITIALIZER(debugallocation, {
#if (__cplusplus >= 201103L)
COMPILE_ASSERT(alignof(debug_malloc_implementation_space) >= alignof(DebugMallocImplementation),
debug_malloc_implementation_space_is_not_properly_aligned);
static_assert(alignof(decltype(debug_malloc_implementation_space)) >= alignof(DebugMallocImplementation),
"DebugMallocImplementation is expected to need just word alignment");
#endif
// Either we or valgrind will control memory management. We
// register our extension if we're the winner. Otherwise let
Expand Down

0 comments on commit c41688b

Please sign in to comment.