https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110242

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We're trying to emit the "no return statement in function returning non-void"
warning, which triggers dump_template_bindings:

 493       push_deferring_access_checks (dk_no_check);
 494       t = tsubst (t, args, tf_none, NULL_TREE);
 495       pop_deferring_access_checks ();

The tsubst leads to tsubst_lambda_expr with complain=tf_none, but there we have

19748       tree body = start_lambda_function (fn, r);

which has no complain, and in it, push_template_decl warns about

5883       warning (OPT_Wtemplates, "template %qD declared", decl);

so we crash.

Reply via email to