diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index e2cc60006..1cdc29c08 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -1235,8 +1235,8 @@ class GenericValue { // return NullValue; // Use static buffer and placement-new to prevent destruction - static char buffer[sizeof(GenericValue)]; - return *new (buffer) GenericValue(); + static GenericValue buffer; + return *new (reinterpret_cast(&buffer)) GenericValue(); } } template