aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2012-06-01 17:19:22 -0400
committerJason Merrill <jason@gcc.gnu.org>2012-06-01 17:19:22 -0400
commitef4b1d6de554112c5716aff60e6b8b56d32328e4 (patch)
tree0d41a42bdf7925b81fc55720afe893570ee516cc /gcc/cp
parent4efa926130748eacb2ab2773cfb16426baed95a2 (diff)
downloadgcc-ef4b1d6de554112c5716aff60e6b8b56d32328e4.zip
gcc-ef4b1d6de554112c5716aff60e6b8b56d32328e4.tar.gz
gcc-ef4b1d6de554112c5716aff60e6b8b56d32328e4.tar.bz2
re PR c++/52725 (error: "capture of non-variable" for new-expression incorrectly parsed as lambda-expression)
PR c++/52725 * parser.c (cp_parser_binary_expression): Bail early if we're parsing tentatively and the LHS has a parse error. From-SVN: r188127
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/parser.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 781f750..ba5937a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2012-06-01 Jason Merrill <jason@redhat.com>
+ PR c++/52725
+ * parser.c (cp_parser_binary_expression): Bail early if we're parsing
+ tentatively and the LHS has a parse error.
+
PR c++/53137
* pt.c (instantiate_class_template_1): Set LAMBDA_EXPR_THIS_CAPTURE.
(instantiate_decl): Don't push_to_top_level for local class methods.
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 547f9e2..7f9a94b 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -7246,6 +7246,9 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p,
current.lhs_type = ERROR_MARK;
current.prec = prec;
+ if (cp_parser_error_occurred (parser))
+ return error_mark_node;
+
for (;;)
{
/* Get an operator token. */