mizvekov wrote:

I figured a reproducer based on your hints:

```C++
template<class T, class U> struct A {};

template<template<class> class TT> auto f(TT<int> a) { return a; }

A<int, float> v1;
A<int, double> v2;

using X = decltype(f(v1));
using Y = decltype(f(v2));
```

Fails with:
```
t.cc:9:20: error: no matching function for call to 'f'
    9 | using Y = decltype(f(v2));
      |                    ^
t.cc:3:41: note: candidate template ignored: deduced type 'A<[...], (default) 
float>' of 1st parameter does not match adjusted type 'A<[...], double>' of 
argument [with TT = A]
    3 | template<template<class> class TT> auto f(TT<int> a) { return a; }
      |                                         ^
```

This shows we are not properly canonicalizing the synthesized template 
declaration.

The problem does not show up with class template partial specializations due to 
a pre-existing issue, but otherwise this was an oversight on my part.

No need to keep reducing on your end, I already have enough to go with.

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

Reply via email to