maybe_instantiate_noexcept doesn't expect to see error_mark_node, but
the new callsite I introduced in r11-6476 can pass error_mark_node to
it. So cope.
gcc/cp/ChangeLog:
PR c++/98790
* pt.c (maybe_instantiate_noexcept): Return false if FN is
error_mark_node.
gcc/testsuite/ChangeLog:
PR c++/98790
* g++.dg/template/deduce8.C: New test.
{
tree fntype, spec, noex, clone;
+ if (fn == error_mark_node)
+ return false;
+
/* Don't instantiate a noexcept-specification from template context. */
if (processing_template_decl
&& (!flag_noexcept_type || type_dependent_expression_p (fn)))
--- /dev/null
+// PR c++/98659
+// { dg-do compile }
+
+template <bool> struct enable_if;
+struct function {
+ template <typename _F> void operator=(_F);
+};
+struct map {
+ function operator[](int);
+};
+enum { E };
+template <typename> void foo ();
+template <typename T>
+typename enable_if<T::value>::type foo ();
+
+void
+bar ()
+{
+ map m;
+ m[E] = foo<int>;
+}