public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107429] misdiagnosed "constraint depends on itself" in overloaded functions
Date: Thu, 27 Oct 2022 12:42:06 +0000	[thread overview]
Message-ID: <bug-107429-4-hKIaej4MDC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107429-4@http.gcc.gnu.org/bugzilla/>

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ppalka at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Thanks for the bug report.  This is a consequence of CWG2369, and the
constraint recursion diagnosis is strictly speaking correct correct.  I think
other compilers accept it because they don't fully implement
https://wg21.link/cwg2369 which moved the constraint satisfaction check during
template argument deduction to _before_ the checking non-dependent conversions.

A workaround (that should be valid pre- and post-CWG2369) is to encode the
non-dependent conversion in the constrained overload of f as an additional
constraint that's checked before the fooable constraint:

  template<std::convertible_to<tag_bar> U, typename... T> requires
(fooable<T...>)
  auto f(U, T... x)

see PR99599 and its dups for more info

*** This bug has been marked as a duplicate of bug 99599 ***

  reply	other threads:[~2022-10-27 12:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 21:03 [Bug c++/107429] New: " jwjagersma at gmail dot com
2022-10-27 12:42 ` ppalka at gcc dot gnu.org [this message]
2022-10-27 16:16 ` [Bug c++/107429] " jwjagersma 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-107429-4-hKIaej4MDC@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).