https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70383
Bug ID: 70383 Summary: Bogus error when attempting to capture a reference to function by copy Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rs2740 at gmail dot com Target Milestone: --- Repro: void meow() { void purr(); void (&f)() = purr; [f]{}; } Per [expr.prim.lambda]/15, capturing a reference to a function by copy should result in an unnamed data member that is also a reference to a function. GCC instead complains: prog.cc: In function 'void meow()': prog.cc:4:6: error: field 'meow()::<lambda()>::<f capture>' invalidly declared function type [f]{}; ^