diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2016-08-04 19:22:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2016-08-04 19:22:58 +0000 |
commit | 4473482d5bedbb34761791bbe68eae4fefaa85d2 (patch) | |
tree | ff6b53c60149f93a0c0d0a241cc00ab0d76a157c /gcc/cp/lambda.c | |
parent | 08156df50a56e4a4bd95159ad1bfbc50678f9e8a (diff) | |
download | gcc-4473482d5bedbb34761791bbe68eae4fefaa85d2.zip gcc-4473482d5bedbb34761791bbe68eae4fefaa85d2.tar.gz gcc-4473482d5bedbb34761791bbe68eae4fefaa85d2.tar.bz2 |
re PR c++/72800 (ICE on invalid C++14 code with initialized lambda capture: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in add_capture, at cp/lambda.c:505)
/cp
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* lambda.c (add_capture): Check lambda_capture_field_type return
value for error_mark_node.
/testsuite
2016-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/72800
* g++.dg/cpp1y/lambda-ice1.C: New.
From-SVN: r239148
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index abb967a..978fa0d 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -492,6 +492,8 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, else { type = lambda_capture_field_type (initializer, explicit_init_p); + if (type == error_mark_node) + return error_mark_node; if (by_reference_p) { type = build_reference_type (type); |