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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-10-18
     Ever confirmed|0                           |1
            Summary|[miscompilation] GCC fails  |GCC fails to match a friend
                   |to match a friend           |declaration with its
                   |declaration with its        |definition when the return
                   |definition when the return  |type is `C<> auto` with a
                   |type is `C<> auto` with a   |defaulted concept argument;
                   |defaulted concept argument; |friendship and access are
                   |friendship and access are   |lost
                   |lost                        |
           Keywords|                            |ice-on-valid-code

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

This also ICEs with what looks like an infinite stack overflow:
```
template <typename T, typename = T>
concept C = true;

class K {
  static int secret() { return 42; }
  template <class T> friend C<> auto peek(T);
};

template <class T> C<> auto peek(T) {
  K::template secret();
}

int main() {
    peek(0);
  return 0;
}
```

Reply via email to