mizvekov wrote:

@eaeltsin You example boils down to https://godbolt.org/z/axnanxP1z:
```C++
template <class> struct xtype_for_shape;
template <template <class, long> class S, class X, long N>
struct xtype_for_shape<S<X, N>> {};

template <class, bool> struct svector;
template struct xtype_for_shape<svector<int, false>>;
```
There is wide divergence between implementations on what happens during 
deduction, at least when NTTPs are involved.

clang picks the partial specialization, all other implementations pick the 
primary template.
This is not something new from this PR either.

The other implementations reject the matching in deduction, but all 
implementations agree that it would work if directly specified: 
https://godbolt.org/z/Gfs3dbYEe

(discounting EDG which doesn't seem to implement P0522R0 at all).

I think what clang does makes the most sense; I see no point in having 
deduction be more strict than the matching itself.

Also, you can create a similar situation with NTTPs where this adds new 
ambiguity: https://godbolt.org/z/cWPM7jWvd

https://github.com/llvm/llvm-project/pull/89807
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to