* lambda.c (is_capture_proxy): Check DECL_DECOMPOSITION_P.
From-SVN: r257761
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.
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)));
}
--- /dev/null
+// PR c++/84420
+// { dg-additional-options -std=c++17 }
+
+int main(){
+ int a[1]{};
+ [&a]{
+ auto [v] = a;
+ (void)v;
+ }();
+}