diff options
author | Jason Merrill <jason@redhat.com> | 2018-04-09 11:32:05 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-04-09 11:32:05 -0400 |
commit | 13c60208d0428ad14b4bd41a63a47d67bd35253f (patch) | |
tree | 0e0706c24ed4dec8f73d5d0ffc1ccdc88426446d /gcc/cp/lambda.c | |
parent | cca538a46e6a482af93cd75b76d357908f0cbd2f (diff) | |
download | gcc-13c60208d0428ad14b4bd41a63a47d67bd35253f.zip gcc-13c60208d0428ad14b4bd41a63a47d67bd35253f.tar.gz gcc-13c60208d0428ad14b4bd41a63a47d67bd35253f.tar.bz2 |
PR c++/85256 - ICE capturing pointer to VLA.
* lambda.c (add_capture): Distinguish between variable-size and
variably-modified types.
From-SVN: r259240
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 3740606..e9b962a 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -554,13 +554,13 @@ add_capture (tree lambda, tree id, tree orig_init, bool by_reference_p, else if (!dependent_type_p (type) && variably_modified_type_p (type, NULL_TREE)) { - error ("capture of variable-size type %qT that is not an N3639 array " + sorry ("capture of variably-modified type %qT that is not an N3639 array " "of runtime bound", type); if (TREE_CODE (type) == ARRAY_TYPE && variably_modified_type_p (TREE_TYPE (type), NULL_TREE)) inform (input_location, "because the array element type %qT has " "variable size", TREE_TYPE (type)); - type = error_mark_node; + return error_mark_node; } else { |