diff options
Diffstat (limited to 'unittests/Support')
-rw-r--r-- | unittests/Support/YAMLIOTest.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/unittests/Support/YAMLIOTest.cpp b/unittests/Support/YAMLIOTest.cpp index f1ae33f..0993d8c 100644 --- a/unittests/Support/YAMLIOTest.cpp +++ b/unittests/Support/YAMLIOTest.cpp @@ -785,15 +785,13 @@ namespace yaml { // Type of "flags" field varies depending on "kind" field. // Use memcpy here to avoid breaking strict aliasing rules. if (kf.kind == kindA) { - AFlags aflags; - memcpy(&aflags, &kf.flags, sizeof(aflags)); + AFlags aflags = static_cast<AFlags>(kf.flags); io.mapRequired("flags", aflags); - memcpy(&kf.flags, &aflags, sizeof(kf.flags)); + kf.flags = aflags; } else { - BFlags bflags; - memcpy(&bflags, &kf.flags, sizeof(bflags)); + BFlags bflags = static_cast<BFlags>(kf.flags); io.mapRequired("flags", bflags); - memcpy(&kf.flags, &bflags, sizeof(kf.flags)); + kf.flags = bflags; } } }; |