This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/69842] New: Parameter deduction in polymorphic lambdas


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]