diff options
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 7c57d67a150..603b69b4876 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -809,8 +809,9 @@ maybe_generic_this_capture (tree object, tree fns) { tree fn = OVL_CURRENT (fns); - if ((!id_expr || TREE_CODE (fn) == TEMPLATE_DECL) - && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)) + if (identifier_p (fns) + || ((!id_expr || TREE_CODE (fn) == TEMPLATE_DECL) + && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))) { /* Found a non-static member. Capture this. */ lambda_expr_this_capture (lam, true); |