re PR libstdc++/89824 (Variant jump table reserves space for __variant_cookie twice)
authorVille Voutilainen <ville.voutilainen@gmail.com>
Tue, 26 Mar 2019 12:41:59 +0000 (14:41 +0200)
committerVille Voutilainen <ville@gcc.gnu.org>
Tue, 26 Mar 2019 12:41:59 +0000 (14:41 +0200)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/std/variant

index 91d8dbc9a3e2a52fb81265c9d8ce0b833e77082a..622426076743d5f2758f936c5f736b473bd34f11 100644 (file)
@@ -1,3 +1,10 @@
+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
index 0984e13725a230268f7a3ea5eadc45094c6f9a09..36314638e633f92bbd8f5d1a85de9d711a44d470 100644 (file)
@@ -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()