This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/69842] New: Parameter deduction in polymorphic lambdas
- From: "carlphilippreh at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Feb 2016 16:15:45 +0000
- Subject: [Bug c++/69842] New: Parameter deduction in polymorphic lambdas
- Auto-submitted: auto-generated
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.