| Issue |
114586
|
| Summary |
C++ constructor interpreted as function when rvalue and using parenthesis, preventing template deduction for aliases
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
mld2443
|
https://godbolt.org/z/fPvqG4Txx
```cpp
template <int> class A {};
A() -> A<0>;
template <int ARG>
using B = A<ARG>;
static_assert(sizeof(B()));
```
GCC deduces `B` to be a type alias for `A` and interprets `B()` as instantiation using deduction guides. clang interprets rvalue as an alias to a function instead of a type constructor, and the template argument deductions are incorrectly rejected.
In order to convince clang that `B` is a type and not a function, we can use braced initialization, `B{}`.
clang and MSVC both consider this ill-formed, however I think GCC is correct here.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs