mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 12:00:11 -05:00
The standard says that in a generic lambda we should speculatively capture 'this' if we see a call to an overload set that contains a non-static member function, but it seems wrong to reject the program if we can't capture, since it might not actually be needed. * lambda.c (lambda_expr_this_capture): Change add_capture_p to int. (maybe_generic_this_capture): Pass -1. From-SVN: r269095
14 lines
218 B
C
14 lines
218 B
C
// PR c++/87685
|
|
// { dg-do compile { target c++14 } }
|
|
|
|
struct A
|
|
{
|
|
template <typename T> static void f(T) {}
|
|
void f() {}
|
|
|
|
void foo()
|
|
{
|
|
[] (auto&& v) { A::f(v); }; // OK if parameter type is specified
|
|
}
|
|
};
|