https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71946
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- I suspect parser->in_function_body is not being set in lambda functions. Most likely because statement expressions are also rejected for the same reason: auto test = []{ int t = ({ int t1; t1 = 0; t1; }); } (I found the testcase above by reading the C++ front-end parser code).