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

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

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

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Thanks for the bug report.  This looks like a dup of PR109751, which is an
unexpected consequence of the CWG2596 resolution (which we proactively
implement IIUC).

A general workaround is to turn the constrained hidden friend into a template,
so that its constraints don't get immediately checked upon instantiation of its
enclosing class (at which point the derived class is still incomplete).

template<class...>
friend constexpr auto tag_invoke(custom::to_char, derived_type const a)
noexcept
    requires(requires { { a.to_char() }; })
{
    return a.to_char();
}

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

Reply via email to