Open
Description
Given this code:
template <class>
struct B {};
struct A {
template <class T>
auto f(T) -> B<decltype([] (T) {})> {
return {};
}
};
int main() {
A{}.f(0);
}
Clang on Windows error:
<source>(6,5): error: cannot mangle this template specialization type yet
6 | auto f(T) -> B<decltype([] (T) {})> {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 | return {};
| ~~~~~~~~~~
8 | }
| ~
Similar error happens on simpler code:
template <class T> // must be a function template
auto f(T) -> decltype([] {}) {
return {};
}
int main() { f(0)(); }
On other platforms with Itanium mangling, or if using MSVC, it can be compiled.
See https://compiler-explorer.com/z/vPz6E5ve7. (Compiler explorer seems to only have version 18 for clang-cl
)
I can reproduce this using the main branch.