Following valid C++ code won't compile:
template<class>
struct S {
template<class>
inline static auto mem = 42;
};
using T = decltype(S<void>::mem<void>);
T y = 42;
int main() {}
Compiling with:
clang++-22 -std=c++17 source.cpp
Errors are as follows:
source.cpp:9:3: error: cannot initialize a variable of type 'T' (aka 'auto') with an rvalue of type 'int'
9 | T y = 42;
| ^ ~~
1 error generated.
This may be related to #56652, since it appears that the Clang frontend does not resolve the auto type, leaving code generation to handle an undeduced type.