diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2018-03-05 15:40:15 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2018-03-05 15:40:15 +0000 |
commit | 5625e74790579b589106e717dba7820933e541f1 (patch) | |
tree | 024dc9c2b60e4d0d63eeaa983a0a814b84156d75 /gcc/cp/parser.c | |
parent | 800916ab502edfefa9efb455c0a9e6455dbdccf5 (diff) | |
download | gcc-5625e74790579b589106e717dba7820933e541f1.zip gcc-5625e74790579b589106e717dba7820933e541f1.tar.gz gcc-5625e74790579b589106e717dba7820933e541f1.tar.bz2 |
re PR c++/84618 (ICE in build_capture_proxy, at cp/lambda.c:460)
/cp
2018-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84618
* parser.c (cp_parser_lambda_introducer): Reject any capture not
involving a VAR_DECL or a PARM_DECL.
/testsuite
2018-03-05 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84618
* g++.dg/cpp0x/lambda/lambda-ice29.C: New.
* g++.dg/cpp0x/lambda/lambda-ice17.C: Adjust.
* g++.dg/cpp0x/lambda/lambda-ice23.C: Likewise.
From-SVN: r258250
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index e1acb07..460b5ea 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10377,15 +10377,15 @@ cp_parser_lambda_introducer (cp_parser* parser, tree lambda_expr) unqualified_name_lookup_error (capture_id); continue; } - else if (DECL_P (capture_init_expr) - && (!VAR_P (capture_init_expr) - && TREE_CODE (capture_init_expr) != PARM_DECL)) + else if (!VAR_P (capture_init_expr) + && TREE_CODE (capture_init_expr) != PARM_DECL) { error_at (capture_token->location, - "capture of non-variable %qD ", + "capture of non-variable %qE ", capture_init_expr); - inform (DECL_SOURCE_LOCATION (capture_init_expr), - "%q#D declared here", capture_init_expr); + if (DECL_P (capture_init_expr)) + inform (DECL_SOURCE_LOCATION (capture_init_expr), + "%q#D declared here", capture_init_expr); continue; } if (VAR_P (capture_init_expr) |