https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86499
Bug ID: 86499 Summary: lambda-expressions with capture-default are allowed at namespace scope Product: gcc Version: 8.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- g++ incorrectly accepts this: auto l = [=]{}; Per C++1y [expr.lambda]p9 this is ill-formed: only local lambda expressions may have capture-defaults (even if they don't actually capture anything).