[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:44:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77641
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2016-09-19
Ever confirmed|0 |1
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The problem is the use of is_literal_type in _Uninitialized:
template<typename _Type, bool __is_literal = std::is_literal_type_v<_Type>>
struct _Uninitialized;
That assumes that a literal type is trivially default-constructible, but that
isn't necessarily true.
std::string_view is a literal type, but is not trivially default constructible.
Is literal type the correct condition? Should it be trivially default
constructible and trivially destructible?
More information about the Gcc-bugs
mailing list