From: Ville Voutilainen Date: Tue, 26 Mar 2019 12:41:59 +0000 (+0200) Subject: re PR libstdc++/89824 (Variant jump table reserves space for __variant_cookie twice) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=11767f80f0be06988b3b317ae0205ae9f79c190c;p=gcc.git re PR libstdc++/89824 (Variant jump table reserves space for __variant_cookie twice) PR libstdc++/89824 Fix based on a suggestion by Antony Polukhin. * include/std/variant (__gen_vtable): Don't reserve an additional table slot, _Multi_array already does that. From-SVN: r269941 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 91d8dbc9a3e..62242607674 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2019-03-26 Ville Voutilainen + + PR libstdc++/89824 + Fix based on a suggestion by Antony Polukhin. + * include/std/variant (__gen_vtable): Don't reserve an + additional table slot, _Multi_array already does that. + 2019-03-26 Ville Voutilainen PR libstdc++/89816 diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 0984e13725a..36314638e63 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -904,9 +904,7 @@ namespace __variant using _Func_ptr = _Result_type (*)(_Visitor&&, _Variants...); using _Array_type = _Multi_array<_Func_ptr, - (variant_size_v> - + (is_same_v<_Result_type, __variant_cookie> ? 1 : 0)) - ...>; + variant_size_v>...>; static constexpr _Array_type _S_apply()