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

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Younan Zhang from comment #2)
> (In reply to Patrick Palka from comment #1)
> > #1 is neither a non-template friend declaration with a requires-clause nor a
> > friend function template with a constraint that depends on a template
> > parameter from an enclosing template, so it seems to me [temp.friend]/9
> > doesn't apply here?
> 
> I'm a bit confused. Doesn't `friend auto factory(const C auto&...)` equal to
> template where `Us` depends on parameter from outter C?
> ```cpp
> template <C... Us>
> friend auto factory(const C Us&...);`
> ```

And IIUC if we desugar the type-constraint C... we get

```cpp
template <class... Us> requires (C<Us> && ...)
friend auto factory(const Us&...);
```

so the friend doesn't have a constraint that depends on an outer template
parameter (Ts)

Reply via email to