X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/fbecd2ab59d461fbd943670338a5def4157e3364..fd003416d59cae9645d164b12495eb186efee848:/data/variant.hh diff --git a/data/variant.hh b/data/variant.hh index 047e641b..91548d84 100644 --- a/data/variant.hh +++ b/data/variant.hh @@ -142,7 +142,10 @@ m4_define([b4_variant_define], {]b4_parse_assert_if([ YYASSERT (tname == typeid (T).name ()); YYASSERT (sizeof (T) <= S);])[ - return reinterpret_cast (buffer.raw); + { + void *dummy = buffer.raw; + return *static_cast (dummy); + } } /// Const accessor to a built \a T (for %printer). @@ -152,7 +155,10 @@ m4_define([b4_variant_define], {]b4_parse_assert_if([ YYASSERT (tname == typeid (T).name ()); YYASSERT (sizeof (T) <= S);])[ - return reinterpret_cast (buffer.raw); + { + const void *dummy = buffer.raw; + return *static_cast (dummy); + } } /// Swap the content with \a other, of same type. @@ -217,7 +223,7 @@ m4_define([b4_variant_define], } buffer;]b4_parse_assert_if([ /// Whether the content is built: if defined, the name of the stored type. - const char* tname;])[ + const char *tname;])[ }; ]])