+2020-04-08 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94507 - ICE-on-invalid with lambda template.
+ * pt.c (tsubst_lambda_expr): Cope when tsubst_template_decl or
+ tsubst_function_decl returns error_mark_node.
+
2020-04-08 Martin Liska <mliska@suse.cz>
PR c++/94314
if (oldtmpl)
{
tmpl = tsubst_template_decl (oldtmpl, args, complain, fntype);
+ if (tmpl == error_mark_node)
+ {
+ r = error_mark_node;
+ goto out;
+ }
fn = DECL_TEMPLATE_RESULT (tmpl);
finish_member_declaration (tmpl);
}
{
tmpl = NULL_TREE;
fn = tsubst_function_decl (oldfn, args, complain, fntype);
+ if (fn == error_mark_node)
+ {
+ r = error_mark_node;
+ goto out;
+ }
finish_member_declaration (fn);
}
maybe_add_lambda_conv_op (type);
}
+out:
finish_struct (type, /*attr*/NULL_TREE);
insert_pending_capture_proxies ();
+2020-04-08 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94507 - ICE-on-invalid with lambda template.
+ * g++.dg/cpp2a/lambda-generic7.C: New test.
+
2020-04-08 Alexandre Oliva <oliva@adacore.com>
* gcc.target/arm/fp16-aapcs-3.c: Explicitly use the
--- /dev/null
+// PR c++/94507 - ICE-on-invalid with lambda template.
+// { dg-do compile { target c++2a } }
+
+struct S { };
+
+template<typename T, typename U>
+auto foo(T, U)
+{
+ [] <> () { foo (S{}, S{}); }; // { dg-error "expected" }
+}