Commit 6f58bc58 by Jason Merrill Committed by Jason Merrill

PR c++/84420 - ICE with structured binding in lambda.

	* lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.

From-SVN: r257761
parent e1617c1d
2018-02-16 Jason Merrill <jason@redhat.com>
PR c++/84420 - ICE with structured binding in lambda.
* lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.
PR c++/83835 - C++17 error with constructor ctors.
* call.c (build_special_member_call): Set TARGET_EXPR_DIRECT_INIT_P.
......
......@@ -261,6 +261,7 @@ is_capture_proxy (tree decl)
return (VAR_P (decl)
&& DECL_HAS_VALUE_EXPR_P (decl)
&& !DECL_ANON_UNION_VAR_P (decl)
&& !DECL_DECOMPOSITION_P (decl)
&& LAMBDA_FUNCTION_P (DECL_CONTEXT (decl)));
}
......
// PR c++/84420
// { dg-additional-options -std=c++17 }
int main(){
int a[1]{};
[&a]{
auto [v] = a;
(void)v;
}();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment