gcc/cp/ChangeLog:
PR c++/70218
* parser.c (cp_parser_lambda_expression): Move call to
pop_deferring_access_checks ahead of the call to
cp_parser_end_tentative_firewall.
gcc/testsuite/ChangeLog:
PR c++/70218
* g++.dg/cpp0x/lambda/lambda-70218.C: New test.
From-SVN: r234316
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70218
+ * parser.c (cp_parser_lambda_expression): Move call to
+ pop_deferring_access_checks ahead of the call to
+ cp_parser_end_tentative_firewall.
+
2016-03-17 Jakub Jelinek <jakub@redhat.com>
PR c++/70144
= auto_is_implicit_function_template_parm_p;
}
- pop_deferring_access_checks ();
-
/* This field is only used during parsing of the lambda. */
LAMBDA_EXPR_THIS_CAPTURE (lambda_expr) = NULL_TREE;
cp_parser_end_tentative_firewall (parser, start, lambda_expr);
+ pop_deferring_access_checks ();
+
return lambda_expr;
}
+2016-03-18 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70218
+ * g++.dg/cpp0x/lambda/lambda-70218.C: New test.
+
2016-03-17 Marek Polacek <polacek@redhat.com>
PR c/69407
--- /dev/null
+// PR c++/70218
+// { dg-do compile { target c++11 } }
+
+struct X {
+private:
+ int i;
+};
+
+struct Y {
+ Y (int) { }
+};
+
+void
+foo ()
+{
+ Y ([] { X x; x.i = 3; return 0; } ()); // { dg-error "private" }
+}