https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79378
Vittorio Romeo <vittorio.romeo at outlook dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vittorio.romeo at outlook dot com --- Comment #2 from Vittorio Romeo <vittorio.romeo at outlook dot com> --- Stumbled upon this again, with this example: template <typename, typename> constexpr bool is_same_v = false; template <typename T> constexpr bool is_same_v<T, T> = true; auto l = [k = 0] { static_assert(is_same_v<decltype(k), int>); }; This bug is still not fixed in the latest version of GCC (trunk). Related StackOverflow post: https://stackoverflow.com/questions/62963712/decltype-of-generalized-lambda-capture-inside-body-of-a-lambda-gcc-vs-clang Example on Compiler Explorer: https://gcc.godbolt.org/z/jY9cfW