https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125605
songb432 at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|UNCONFIRMED |RESOLVED
--- Comment #9 from songb432 at gmail dot com ---
(In reply to Jonathan Wakely from comment #8)
> (In reply to songb432 from comment #6)
> > I suppose you're right there. But let's see `Example3`:
> > ```
> > namespace Example3 { // see also
> > https://eel.is/c++draft/temp.constr#decl-example-2
> > template <class T> concept C = true;
> > template <class T> struct A {
> > template <class U> U f(U) requires C<typename T::type>; // #1
> > template <class U> U f(U) requires C<T>; // #2
> > };
> > using U = decltype(A<int>{}.f(2));
> > } // namespace Example3
> > ```
> > It doesn't compile because the compiler thinks `call of overloaded 'f(int)'
> > is ambiguous`.
>
> This looks like exactly the same issue, your concept C doesn't use T at all.
>
>
> (In reply to songb432 from comment #7)
> > There's another issue: GCC 10 ~ 16 all behaves the same on those examples,
> > but Clang 17 ~ 21 behaves (the way I expect) different from GCC, but but,
> > Clang 22 behaves the same with GCC. I'm not sure if Clang 22 did think the
> > behaviour of Clang 17 ~ 21 has any bug, since I didn't find anything
> > concerning this.
> > See that on https://godbolt.org/z/zdosxqdf1
>
> So Clang fixed a bug ... that's good, isn't it?
I agree. So it's all about parameter mapping. I misunderstood some rule about
normalization. But I still can't figure out this:
```
template <class T> concept C = true;
template <class T> struct A {
template <class U> U f(U) requires C<typename T::type>; // #1
template <class U> U f(U) requires C<T>; // #2
};
template <> template <class U>
U A<int>::f(U u) requires C<int> { return u; } // OK, specializes
#2
```
This does compile, while `A<int>{}.f(2)` does not. Why? Is it a DR?