]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/pt.c
PR c++/86969 - ICE with constexpr if and recursive generic lambdas.
[thirdparty/gcc.git] / gcc / cp / pt.c
index d678e27807810a2353a6f3ebdbc60ff79a953025..673ea8e2258136722b09651d9b65879fde0f081e 100644 (file)
@@ -17989,6 +17989,10 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
       if (PACK_EXPANSION_P (ofield))
        ofield = PACK_EXPANSION_PATTERN (ofield);
       tree field = tsubst_decl (ofield, args, complain);
+      if (DECL_VLA_CAPTURE_P (ofield))
+       /* The type of a VLA capture might not have a TAG_DEFN in the enclosing
+          context, so complete it here.  */
+       complete_type (TREE_TYPE (field));
 
       if (DECL_PACK_P (ofield) && !DECL_NORMAL_CAPTURE_P (ofield))
        {