Issue 167513
Summary [Clang][Regression] CTAD failure for alias template with non-type template argument
Labels clang
Assignees
Reporter MagentaTreehouse
    Consider the following C++20 code:
```c++
template <class T, T>
struct A {};

template <class T>
using AA = A<T, T{}>;

AA<int> a;
AA b{a};
```

Error since Clang trunk:
```console
<source>:8:4: error: no viable constructor or deduction guide for deduction of template arguments of 'AA'
    8 | AA b{a};
      |    ^
<source>:5:1: note: candidate template ignored: deduced type 'A<[...], int{}>' of 1st parameter does not match adjusted type 'A<[...], int{} aka 0>' of argument [with T = int]
    5 | using AA = A<T, T{}>;
      | ^
<source>:5:1: note: implicit deduction guide declared as 'template <class T> requires __is_deducible(AA, A<T, T{}>) AA(A<T, T{}>) -> A<T, T{}>'
<source>:5:1: note: candidate function template not viable: requires 0 arguments, but 1 was provided
<source>:5:1: note: implicit deduction guide declared as 'template <class T> requires __is_deducible(AA, A<T, T{}>) AA() -> A<T, T{}>'
1 error generated.
```

See https://compiler-explorer.com/z/jdeo8ajcc.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to