https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759
Kai Tietz <ktietz at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ktietz at gcc dot gnu.org --- Comment #11 from Kai Tietz <ktietz at gcc dot gnu.org> --- Hmm, I think this might be not the thing wanted here. But infact having a VAR_DECL can be caused by prior errors introducing them. So we might simple want to treat VAR_DECL in unify via unify_template_argument_mismatch. ChangeLog 2014-12-22 Kai Tietz <kti...@redhat.com> PR c++/59759 * pt.c (unify): Don't ICE on VAR_DECL. Regression tested on x86_64-w64-mingw32. Ok for apply? Regards, Kai Index: pt.c =================================================================== --- pt.c (Revision 219014) +++ pt.c (Arbeitskopie) @@ -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),