Skip to content

Commit

Permalink
Merge 54dab1e into 4956227
Browse files Browse the repository at this point in the history
  • Loading branch information
Romain-Geissler-1A committed Feb 19, 2018
2 parents 4956227 + 54dab1e commit 09596e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/rapidjson/document.h
Expand Up @@ -2014,7 +2014,12 @@ class GenericValue {
if (count) {
GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
SetElementsPointer(e);
RAPIDJSON_DIAG_PUSH
#if defined(__GNUC__) && __GNUC__ >= 8
RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
#endif
std::memcpy(e, values, count * sizeof(GenericValue));
RAPIDJSON_DIAG_POP
}
else
SetElementsPointer(0);
Expand All @@ -2027,7 +2032,12 @@ class GenericValue {
if (count) {
Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
SetMembersPointer(m);
RAPIDJSON_DIAG_PUSH
#if defined(__GNUC__) && __GNUC__ >= 8
RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
#endif
std::memcpy(m, members, count * sizeof(Member));
RAPIDJSON_DIAG_POP
}
else
SetMembersPointer(0);
Expand Down

0 comments on commit 09596e9

Please sign in to comment.