return-type deduction failure for lambda inside decltype.
Open
clang:frontend
diverges-from:gcc
lambda
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
This fails to compile on clang-trunk.
```cpp
template
using X = decltype(
[]{
if constexpr(I == 0)
return int{};
else
return char{};
}()
);
template
inline constexpr auto Y = X{};
static_assert(Y<1> == char{});
```
Need to inject a template-param () for it to work.
Works on gcc. Godbolt: https://godbolt.org/z/3Ydv8b866.
Contributor guide
Assessment
This issue has not been assessed yet.