[v3] PR libstdc++/89824

Message ID CAFk2RUb7kx_xx7u00yZ908sWfqu_X=4=_4GhNnzwuqWAVPTVng@mail.gmail.com
State New
Headers show
Series
  • [v3] PR libstdc++/89824
Related show

Commit Message

Ville Voutilainen March 26, 2019, 12:14 p.m.
A minor thinko, very easy to fix.

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.

Comments

Jonathan Wakely March 26, 2019, 12:35 p.m. | #1
On 26/03/19 14:14 +0200, Ville Voutilainen wrote:
>A minor thinko, very easy to fix.


OK, thanks.

Patch

diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant
index 0984e13..3631463 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<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()