===================================================================
@@ -18490,11 +18490,12 @@ unify (tree tparms, tree targs, tree parm, tree ar
case VAR_DECL:
/* A non-type template parameter that is a variable should be a
- an integral constant, in which case, it whould have been
+ an integral constant, in which case, it should have been
folded into its (constant) value. So we should not be getting
- a variable here. */
- gcc_unreachable ();
+ a variable here out-side of an error-case. */
+ return unify_template_argument_mismatch (explain_p, parm, arg);
+
case TYPE_ARGUMENT_PACK:
case NONTYPE_ARGUMENT_PACK:
return unify (tparms, targs, ARGUMENT_PACK_ARGS (parm),