+2019-04-01 Jason Merrill <jason@redhat.com>
+
+ PR c++/86946 - ICE with function call in template argument.
+ DR 1321
+ * pt.c (iterative_hash_template_arg) [CALL_EXPR]: Use
+ dependent_name.
+
2019-04-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/62207
/* Now hash operands as usual. */
break;
+ case CALL_EXPR:
+ {
+ tree fn = CALL_EXPR_FN (arg);
+ if (tree name = dependent_name (fn))
+ {
+ if (TREE_CODE (fn) == TEMPLATE_ID_EXPR)
+ val = iterative_hash_template_arg (TREE_OPERAND (fn, 1), val);
+ fn = name;
+ }
+ val = iterative_hash_template_arg (fn, val);
+ call_expr_arg_iterator ai;
+ for (tree x = first_call_expr_arg (arg, &ai); x;
+ x = next_call_expr_arg (&ai))
+ val = iterative_hash_template_arg (x, val);
+ return val;
+ }
+
default:
break;
}
--- /dev/null
+// PR c++/86946, DR 1321
+// { dg-do compile { target c++11 } }
+
+int d(int, int);
+template <long> class e {};
+template <unsigned long f, unsigned b, typename> e<sizeof(d(f, b))> d();
+template <unsigned long f, unsigned b, typename> e<d(f, b)> d();
+
+template <class T, class U> constexpr T d2(T, U) { return 42; }
+template <unsigned long f, unsigned b, typename> e<d2(f, b)> d2();
+template <unsigned long f, unsigned b, typename> e<d2(f, b)> d2();
+
+template <typename a, typename c> a d3(a, c);
+template <unsigned long f, unsigned b, typename> e<sizeof(d3(f, b))> d3();
+template <unsigned long f, unsigned b, typename> e<sizeof(d3(f, b))> d3();
+
+
+int main()
+{
+ d<1,2,int>();
+ d2<1,2,int>();
+ d3<1,2,int>();
+}