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 libstdc++/109242] C++2b std::optional::transform omits required std::remove_cv_t from return optional type
Date: Wed, 29 Mar 2023 21:26:00 +0000 [thread overview]
Message-ID: <bug-109242-4-pDxCRZZxmj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-109242-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109242
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Assignee|unassigned at gcc dot gnu.org |redi at gcc dot gnu.org
Status|NEW |ASSIGNED
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Peter Kasting from comment #2)
> struct S {
> int& i() const;
> };
>
> void foo() {
> std::optional<S>().transform(&S::i);
The U type is a reference here, which isn't allowed.
This shows the bug:
struct A { };
const A f(int);
std::optional<int> o;
A&& p = *o.transform(f);
next prev parent reply other threads:[~2023-03-29 21:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-21 23:31 [Bug libstdc++/109242] New: " pkasting at google dot com
2023-03-21 23:40 ` [Bug libstdc++/109242] " redi at gcc dot gnu.org
2023-03-22 2:53 ` rs2740 at gmail dot com
2023-03-22 3:02 ` pkasting at google dot com
2023-03-29 21:26 ` redi at gcc dot gnu.org [this message]
2023-03-29 23:45 ` cvs-commit at gcc dot gnu.org
2023-03-29 23:47 ` redi at gcc dot gnu.org
2023-03-30 8:08 ` cvs-commit at gcc dot gnu.org
2023-03-30 8:09 ` redi at gcc dot gnu.org
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-109242-4-pDxCRZZxmj@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).