https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69842
Bug ID: 69842 Summary: Parameter deduction in polymorphic lambdas Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: carlphilippreh at gmail dot com Target Milestone: --- The following code fails to compile with gcc-6-20160214. It used to work with gcc-5.3 and clang also accepts it. Compile with -std=c++14. #include <type_traits> int main() { auto const g([](auto && _var) { static_assert(std::is_same<int &&,decltype(_var)>::value,""); }); g(0); } I don't have the C++14 standard handy, so I am not sure if this is correct behavior or not. In any case, this breaks code that perfectly forwards using a lambda.