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++/83445] conversion function has too high priority in overload resolution Date: Tue, 18 Aug 2020 09:48:20 +0000 [thread overview] Message-ID: <bug-83445-4-PN7Ew1E9Ld@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-83445-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83445 --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- Invoking Target(Source const&) is a user-defined conversion too. The conversion sequence requires binding a reference to the Source object and then converting it to a Target. In C++17 there is no call to Target(Target const&) or Target(Target&&) because the temporary returned by Source::operator Target() is materialized directly into an object of type Target. Clang agrees with GCC that Source::operator Target() is a better conversion, but I can't find the wording specifying that.
next prev parent reply other threads:[~2020-08-18 9:48 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-83445-4@http.gcc.gnu.org/bugzilla/> 2020-08-17 18:06 ` karzh at mail dot ru 2020-08-18 9:48 ` redi at gcc dot gnu.org [this message] 2020-08-18 13:02 ` mpolacek at gcc dot gnu.org 2020-08-18 20:29 ` karzh at mail dot ru 2020-08-19 6:44 ` karzh at mail dot ru
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-83445-4-PN7Ew1E9Ld@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).