public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pkasting at google dot com" <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, 22 Mar 2023 03:02:20 +0000	[thread overview]
Message-ID: <bug-109242-4-CfKKu4pFMj@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

--- Comment #2 from Peter Kasting <pkasting at google dot com> ---
(In reply to TC from comment #1)
> The missing remove_cv_t is real, but this example is invalid. As the linked
> cppreference page notes, you cannot pass a PMD to transform.

Ah, true! How about this then: https://godbolt.org/z/TaccPEsY1

#include <optional>

struct S {
  int& i() const;
};

void foo() {
  std::optional<S>().transform(&S::i);
}

  parent reply	other threads:[~2023-03-22  3:02 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 [this message]
2023-03-29 21:26 ` redi at gcc dot gnu.org
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-CfKKu4pFMj@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).