public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "m.cencora at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/94062] Cannot construct tuple from convertible types
Date: Thu, 19 Mar 2020 12:12:30 +0000 [thread overview]
Message-ID: <bug-94062-4-nYcoEfaybs@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 #7 from m.cencora at gmail dot com ---
(In reply to Jonathan Wakely from comment #6)
> Further reduced:
>
> struct Bar1
> {
> Bar1(Bar1&&) = delete;
> };
>
> struct Foo1
> {
> operator Bar1() const;
> };
>
> struct tuple : Bar1
> {
> tuple() : Bar1(Foo1{}) { }
> };
>
> tuple t;
>
>
>
> elide.cc: In constructor 'tuple::tuple()':
> elide.cc:13:24: error: use of deleted function 'Bar1::Bar1(Bar1&&)'
> 13 | tuple() : Bar1(Foo1{}) { }
> | ^
> elide.cc:3:3: note: declared here
> 3 | Bar1(Bar1&&) = delete;
> | ^~~~
>
>
> But I think this may be another instance of PR 82113 and elision shouldn't
> be done here.
Standard says that if:
std::is_constructible_v<Bar, Foo&&>
then
std::is_constructible_v<std::tuple<Bar>, Foo&&>
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.
But I guess to fix this you would have to break ABI (or change C++ standard).
next prev parent reply other threads:[~2020-03-19 12:12 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 [this message]
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
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-nYcoEfaybs@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: link
Be 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).