diff options
author | Jason Merrill <jason@redhat.com> | 2019-02-21 21:47:33 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2019-02-21 21:47:33 -0500 |
commit | d36b4bf75260d7228025af59fd811e3fd48993c6 (patch) | |
tree | c7651d1c930598b81c7bbd3ce9550c3a9b94f0c5 /gcc/cp/lambda.c | |
parent | c8b7e64d363069c6682bdeb51ba397e8bd4a4f9e (diff) | |
download | gcc-d36b4bf75260d7228025af59fd811e3fd48993c6.zip gcc-d36b4bf75260d7228025af59fd811e3fd48993c6.tar.gz gcc-d36b4bf75260d7228025af59fd811e3fd48993c6.tar.bz2 |
PR c++/88394 - ICE with VLA init-capture.
We mostly use is_normal_capture_proxy to decide whether or not to use
DECL_CAPTURED_VARIABLE; we could just check whether it's set. VLA capture
is still mostly broken, but this fixes this ICE.
* lambda.c (is_normal_capture_proxy): Check DECL_CAPTURED_VARIABLE.
From-SVN: r269094
Diffstat (limited to 'gcc/cp/lambda.c')
-rw-r--r-- | gcc/cp/lambda.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c index 3b803ad..7032168 100644 --- a/gcc/cp/lambda.c +++ b/gcc/cp/lambda.c @@ -279,20 +279,8 @@ is_normal_capture_proxy (tree decl) /* It's not a capture proxy. */ return false; - if (variably_modified_type_p (TREE_TYPE (decl), NULL_TREE)) - /* VLA capture. */ - return true; - - /* It is a capture proxy, is it a normal capture? */ - tree val = DECL_VALUE_EXPR (decl); - if (val == error_mark_node) - return true; - - if (TREE_CODE (val) == ADDR_EXPR) - val = TREE_OPERAND (val, 0); - gcc_assert (TREE_CODE (val) == COMPONENT_REF); - val = TREE_OPERAND (val, 1); - return DECL_NORMAL_CAPTURE_P (val); + return (DECL_LANG_SPECIFIC (decl) + && DECL_CAPTURED_VARIABLE (decl)); } /* Returns true iff DECL is a capture proxy for a normal capture |