This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/77641] std::variant copy-initialization fails for type with non-trivial constexpr ctor
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 19 Sep 2016 11:44:06 +0000
- Subject: [Bug libstdc++/77641] std::variant copy-initialization fails for type with non-trivial constexpr ctor
- Auto-submitted: auto-generated
- References: <bug-77641-4@http.gcc.gnu.org/bugzilla/>
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?