commit e979dc834d91e52c0c568f85c2b62ec67dac3cdc
Author: Jason Merrill <jason@redhat.com>
Date: Mon Mar 12 01:01:14 2018 -0400
PR c++/84802 - ICE capturing uninstantiated class.
* lambda.c (build_capture_proxy): Call complete_type.
@@ -432,6 +432,8 @@ build_capture_proxy (tree member, tree init)
object = convert (type, ptr);
}
+ complete_type (type);
+
var = build_decl (input_location, VAR_DECL, name, type);
SET_DECL_VALUE_EXPR (var, object);
DECL_HAS_VALUE_EXPR_P (var) = 1;
new file mode 100644
@@ -0,0 +1,11 @@
+// PR c++/84802
+// { dg-do compile { target c++14 } }
+
+template <class T> struct A { };
+
+void f (A<int>& ar)
+{
+ [](const auto& x)
+ { return [x]{}(); }
+ (ar);
+}