From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19924 invoked by alias); 22 Dec 2014 20:57:42 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19885 invoked by uid 48); 22 Dec 2014 20:57:38 -0000 From: "ktietz at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/59759] internal compiler error: in unify, using std::enable_if on classes Date: Mon, 22 Dec 2014 20:57:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.8.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ktietz at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg02599.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59759 Kai Tietz changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ktietz at gcc dot gnu.org --- Comment #11 from Kai Tietz --- 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 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),