aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2016-07-21 02:05:58 -0400
committerJason Merrill <jason@gcc.gnu.org>2016-07-21 02:05:58 -0400
commit172f0e1311f23be40aeb4816f77793dc1317612d (patch)
tree014a54747e8583208709b6c6070f0a7219e2cf58 /gcc/cp/parser.c
parentdd5dda561e34151f0145d0c0ceabf4d4a14509a3 (diff)
downloadgcc-172f0e1311f23be40aeb4816f77793dc1317612d.zip
gcc-172f0e1311f23be40aeb4816f77793dc1317612d.tar.gz
gcc-172f0e1311f23be40aeb4816f77793dc1317612d.tar.bz2
PR c++/70781 - ICE on ill-formed lambda.
* parser.c (cp_parser_lambda_expression): Unset OK if there was an error parsing the lambda-declarator. From-SVN: r238563
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 9bdb108..b71b9e5a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -9771,10 +9771,12 @@ cp_parser_lambda_expression (cp_parser* parser)
ok &= cp_parser_lambda_declarator_opt (parser, lambda_expr);
+ if (ok && cp_parser_error_occurred (parser))
+ ok = false;
+
if (ok)
{
- if (!cp_parser_error_occurred (parser)
- && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
+ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE)
&& cp_parser_start_tentative_firewall (parser))
start = token;
cp_parser_lambda_body (parser, lambda_expr);