diff options
-rw-r--r-- | include/rapidjson/document.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 74089cb9..ea6d8069 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1235,8 +1235,8 @@ public: // return NullValue; // Use static buffer and placement-new to prevent destruction - static GenericValue buffer; - return *new (reinterpret_cast<char *>(&buffer)) GenericValue(); + alignas(GenericValue) static char buffer[sizeof(GenericValue)]; + return *new (buffer) GenericValue(); } } template <typename SourceAllocator> |