Fix the alignment of placement new buffer for GenericValue.
When using operator[] on a GenericValue type clang-tidy complains, appropriately, about the alignment of the buffer used for placement-new of the "dummy" GenericValue.
This commit is contained in:
parent
fd3dc29a5c
commit
5b242b6b2d
@ -1235,8 +1235,8 @@ public:
|
||||
// return NullValue;
|
||||
|
||||
// Use static buffer and placement-new to prevent destruction
|
||||
static char buffer[sizeof(GenericValue)];
|
||||
return *new (buffer) GenericValue();
|
||||
static GenericValid buffer;
|
||||
return *new (reinterpret_cast<char *>(&buffer)) GenericValue();
|
||||
}
|
||||
}
|
||||
template <typename SourceAllocator>
|
||||
|
Loading…
x
Reference in New Issue
Block a user