Talk:cpp/language/auto

The example says, but this appears to be deduced as int in all compilers I've tried in C++11 mode, presumably this was DR'd by something --Ybab321 (talk) 04:36, 16 March 2021 (PDT)
 * gcc 4.9.3 and clang 3.7.1 are the last versions that make it an initializer_list in C++11 mode, seems you're right --Cubbi (talk) 10:56, 16 March 2021 (PDT)

Question on explanation of decltype(auto)
It is said that

and before C++20, lambda expressions are forbidden in unevaluated expressions such as in.

But I tested via godbolt on both gcc and clang in c++14 mode, and following code compiles successfully

Doesn't this example construct a implicitly? Or our explanation is inaccurate? --Yaossg (talk) 06:38, 8 May 2023 (PDT)


 * the C++17 wording was "as though e had been the operand of the decltype" so cppreference matches the standard, even if prim.lambda/2 said it shall not appear there. Seems compilers didn't think "as though" meant "literally" even before it became allowed. --Cubbi (talk) 07:58, 8 May 2023 (PDT)