public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94062] Cannot construct tuple from convertible types Date: Mon, 17 Aug 2020 10:23:18 +0000 [thread overview] Message-ID: <bug-94062-4-fF0T5juN9U@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-94062-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94062 --- Comment #11 from Jonathan Wakely <redi at gcc dot gnu.org> --- > Standard says that if: > std::is_constructible_v<Bar, Foo&&> > then > std::is_constructible_v<std::tuple<Bar>, Foo&&> Where does it say that? The fact a constructor participates in overload resolution doesn't mean it has to be well-formed for all template arguments. > So I think this is not an instance of PR 82113, but an unfortunate > consequence of how tuple is implemented in libstdc++. If tuple elements were > not stored as base classes, but as members than elision is mandatory and it > would work. Members using [[no_unique_address]] have the same restrictions. > But I guess to fix this you would have to break ABI (or change C++ standard). It wouldn't be an ABI break to make this compile with our std::tuple, because it never compiled previously. But I'm a little uncomfortable with making the ABI of std::tuple depend on whether its elements are copy constructible, rather than just on the elements' layout. That would mean that std::tuple<Bar> changes layout if you later add a move constructor to Bar.
next prev parent reply other threads:[~2020-08-17 10:23 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-94062-4@http.gcc.gnu.org/bugzilla/> 2020-03-19 9:46 ` [Bug libstdc++/94062] " m.cencora at gmail dot com 2020-03-19 10:43 ` redi at gcc dot gnu.org 2020-03-19 10:49 ` redi at gcc dot gnu.org 2020-03-19 10:57 ` m.cencora at gmail dot com 2020-03-19 11:30 ` [Bug c++/94062] " redi at gcc dot gnu.org 2020-03-19 12:04 ` redi at gcc dot gnu.org 2020-03-19 12:12 ` m.cencora at gmail dot com 2020-03-19 12:38 ` redi at gcc dot gnu.org 2020-03-19 12:42 ` m.cencora at gmail dot com 2020-03-19 14:18 ` redi at gcc dot gnu.org 2020-08-17 10:23 ` redi at gcc dot gnu.org [this message] 2020-08-17 12:02 ` m.cencora at gmail dot com 2020-08-17 12:51 ` redi at gcc dot gnu.org 2020-08-17 13:40 ` m.cencora at gmail dot com 2020-08-17 13:58 ` redi at gcc dot gnu.org 2020-08-17 14:29 ` cvs-commit at gcc dot gnu.org 2020-08-17 14:51 ` m.cencora at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-94062-4-fF0T5juN9U@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).