[clang] [Clang] Correctly deduce default argument for alias CTAD (PR #193836)
Corentin Jabot via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 23 14:07:17 PDT 2026
cor3ntin wrote:
@zyn0217 @mizvekov
This does not actually fully solve the problem yet,
Given
```cpp
template <auto>
struct A {};
template <class U>
using Foo = A<U{}>;
template <class UUUU = int>
using Bar = Foo<UUUU>;
Bar a{};
```
`UUUU` is correctly deduced, but not correctly substituted - we end up with `A<U{}>' (without substitution at runtime)
Which is a bit weird given that `transformTemplateParameter` should transform the argument.
Anyway, time for me to call it a night, I'll see tomorrow if either of you has a brilliant idea :)
(CTAD for alias is so complicated, not sure if it's the feature or our implementation of it...)
https://github.com/llvm/llvm-project/pull/193836
More information about the cfe-commits
mailing list