* parser.c (cp_parser_lambda_introducer): Clear scope after
each lambda capture.
From-SVN: r258043
+2018-02-27 Håkon Sandsmark <hsandsmark@gmail.com>
+
+ PR c++/71546 - lambda init-capture with qualified-id.
+ * parser.c (cp_parser_lambda_introducer): Clear scope after
+ each lambda capture.
+
2018-02-27 Nathan Sidwell <nathan@acm.org>
PR c++/84426
capture_init_expr,
/*by_reference_p=*/capture_kind == BY_REFERENCE,
explicit_init_p);
+
+ /* If there is any qualification still in effect, clear it
+ now; we will be starting fresh with the next capture. */
+ parser->scope = NULL_TREE;
+ parser->qualifying_scope = NULL_TREE;
+ parser->object_scope = NULL_TREE;
}
cp_parser_require (parser, CPP_CLOSE_SQUARE, RT_CLOSE_SQUARE);
--- /dev/null
+// PR c++/71546
+// { dg-do compile { target c++14 } }
+
+namespace n { struct make_shared { }; }
+
+int main()
+{
+ int x1;
+ [e = n::make_shared (), x1]() {};
+}