[clang] [clang] check deduction consistency when partial ordering function templates (PR #100692)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 15 23:52:47 PDT 2024
mizvekov wrote:
Hello, sorry I missed your earlier notification.
Your test case further reduces to: https://godbolt.org/z/q6ndebaeW
```C++
template <char> struct Traits { using Type = Traits; };
template <char... ArgType> void FillVRegs(typename Traits<ArgType>::Type...);
template <char FirstArgType> void FillVRegs(typename Traits<FirstArgType>::Type);
void foo() { FillVRegs<'A'>(Traits<'A'>()); }
```
I believe Clang and GCC are correct to reject this, we can't partial order `FillVRegs` because we can't deduce anything from the function arguments.
https://github.com/llvm/llvm-project/pull/100692
More information about the cfe-commits
mailing list