/* Types INTEGER_CST and MINUS_EXPR can come from array bounds. */
/* Type INTEGER_CST can come from ordinary constant template args. */
case INTEGER_CST:
+ case REAL_CST:
while (CONVERT_EXPR_P (arg))
arg = TREE_OPERAND (arg, 0);
- if (TREE_CODE (arg) != INTEGER_CST)
+ if (TREE_CODE (arg) != TREE_CODE (parm))
return unify_template_argument_mismatch (explain_p, parm, arg);
- return (tree_int_cst_equal (parm, arg)
+ return (simple_cst_equal (parm, arg)
? unify_success (explain_p)
: unify_template_argument_mismatch (explain_p, parm, arg));
--- /dev/null
+// PR c++/110809
+// { dg-do compile { target c++20 } }
+
+template<class, double> struct A { };
+
+template<class T> void f(A<T, 1.0>);
+template<class T> void f(A<T, 2.0>);
+
+int main() {
+ f(A<int, 1.0>{});
+ f(A<int, 1.1>{}); // { dg-error "no match" }
+}