diff options
author | Jason Merrill <jason@redhat.com> | 2012-06-01 17:19:22 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2012-06-01 17:19:22 -0400 |
commit | ef4b1d6de554112c5716aff60e6b8b56d32328e4 (patch) | |
tree | 0d41a42bdf7925b81fc55720afe893570ee516cc /gcc/cp/parser.c | |
parent | 4efa926130748eacb2ab2773cfb16426baed95a2 (diff) | |
download | gcc-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/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 3 |
1 files changed, 3 insertions, 0 deletions
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. */ |