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++/108393] circular concept false-positive
Date: Fri, 13 Jan 2023 16:15:10 +0000	[thread overview]
Message-ID: <bug-108393-4-2G2jPbk7pW@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108393-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108393

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Specifically, ADL for __t == __u finds this function:

  template<C _Iter>
  friend constexpr bool operator==(unreachable_sentinel_t, const _Iter&)
noexcept;

making it an overload resolution candidate. It's not viable, because __t and
__u (which are the same type) cannot be converted to unreachable_sentinel_t.
But if the other parameter is checked first, then that means checking whether
S<unreachable_sentinel_t> satisfies C, because of the constraint C _Iter.

[over.match.viable] says:

- First, to be a viable function, a candidate function shall have enough
parameters to agree in number with the arguments in the list.

This condition is met.

- Second, for a function to be viable, if it has associated constraints
([temp.constr.decl]), those constraints shall be satisfied

The associated constraints are that _Iter satisfies C. This is where the cycle
happens.

- Third, for F to be a viable function, there shall exist for each argument an
implicit conversion sequence that converts that argument to the corresponding
parameter of F.

This is when the function would be discarded from the candidate set, because
S<unreachable_sentinel_t> cannot be converted to unreachable_sentinel_t. But
it's too late, we already blew up at the second step.

  parent reply	other threads:[~2023-01-13 16:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 13:58 [Bug c++/108393] New: " nikolasklauser at berlin dot de
2023-01-13 16:09 ` [Bug c++/108393] " redi at gcc dot gnu.org
2023-01-13 16:15 ` redi at gcc dot gnu.org [this message]
2023-01-13 16:28 ` ppalka at gcc dot gnu.org
2023-01-27 17:02 ` pinskia at gcc dot gnu.org
2023-05-19  3:34 ` pinskia at gcc dot gnu.org
2024-03-09 15:37 ` ppalka 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-108393-4-2G2jPbk7pW@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).