[Bug libstdc++/77641] std::variant copy-initialization fails for type with non-trivial constexpr ctor

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Sep 19 11:48:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77641

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Testing this:

--- a/libstdc++-v3/include/std/variant
+++ b/libstdc++-v3/include/std/variant
@@ -168,7 +168,7 @@ namespace __variant
   template<typename _Type>
     using __storage = typename __storage_type<_Type>::type;

-  template<typename _Type, bool __is_literal = std::is_literal_type_v<_Type>>
+  template<typename _Type, bool = is_trivially_default_constructible_v<_Type>>
     struct _Uninitialized;

   template<typename _Type>


More information about the Gcc-bugs mailing list