X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/f29f8af3edf5b678f812e36ea4416983467e9189..be6fa942acae21a4a025bac5e339451be6ad136d:/data/variant.hh diff --git a/data/variant.hh b/data/variant.hh index 047e641b..e2a537ad 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.