[clang] [Clang][NFCI] Prefer non-canonical template arguments for synthesized CTAD guides (PR #99840)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 00:32:03 PDT 2024


https://github.com/hokein commented:

Thanks, the diagnostics in the test look much better.

There is an ambiguous case that I'm a little concerned about: if the alias template parameter and the underlying template parameter have the same name, the synthesized deduction guide may end up with two template parameters with the same name. For instance, see [this example](https://godbolt.org/z/q1n7Edzcz). In such cases, we cannot distinguish between the `T1` parameters from the function signature `auto (T1, T1) -> X<T1, double>`.

However, the diagnostic improvement looks promising, and this seems like the right tradeoff.

https://github.com/llvm/llvm-project/pull/99840


More information about the cfe-commits mailing list