Commit 11767f80 by Ville Voutilainen Committed by Ville Voutilainen

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
parent 8be4d02b
2019-03-26 Ville Voutilainen <ville.voutilainen@gmail.com>
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 <ville.voutilainen@gmail.com>
PR libstdc++/89816
Fix based on a suggestion by Antony Polukhin.
* include/std/variant (__variant_construct): Capture a pointer
......
......@@ -904,9 +904,7 @@ namespace __variant
using _Func_ptr = _Result_type (*)(_Visitor&&, _Variants...);
using _Array_type =
_Multi_array<_Func_ptr,
(variant_size_v<remove_reference_t<_Variants>>
+ (is_same_v<_Result_type, __variant_cookie> ? 1 : 0))
...>;
variant_size_v<remove_reference_t<_Variants>>...>;
static constexpr _Array_type
_S_apply()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment