Is the following code valid in accordance with (any) ISO C ++ standards?
#include <functional>
auto a() {
struct Foo {
};
return []() {return Foo{}; };
}
int main()
{
auto l = a()();
decltype(l) ll;
return 0;
}
Compilers (Visual studio 2015, the last Clang and the last GCC) accept this, but it seems strange that decltype should give me access to Foo,
source
share