[Bug c++/107429] misdiagnosed "constraint depends on itself" in overloaded functions

2022-10-27 Thread jwjagersma at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107429

--- Comment #2 from jwjagersma at gmail dot com ---
Thanks, I thought I searched but somehow missed that PR.
>From a user perspective it seems very surprising that this workaround compiles,
but the obvious implementation doesn't.  I do hope it gets addressed someday.

[Bug c++/107429] misdiagnosed "constraint depends on itself" in overloaded functions

2022-10-27 Thread ppalka at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107429

Patrick Palka  changed:

   What|Removed |Added

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

--- Comment #1 from Patrick Palka  ---
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 U, typename... T> requires
(fooable)
  auto f(U, T... x)

see PR99599 and its dups for more info

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