From 1ba3448942be0df14c26ac139161435e91dc43fc Mon Sep 17 00:00:00 2001 From: asutton Date: Tue, 12 Nov 2013 21:31:10 +0000 Subject: [PATCH] 2013-11-012 Andrew Sutton * gcc/cp/semantics.c (fixup_template_type): Compare primary template types to specializations using structural types so we don't run into canonical type errors with constrained specializations. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/c++-concepts@204719 138bc75d-0d04-0410-961f-82ee72b054a4 --- ChangeLog.concepts | 5 +++++ gcc/cp/semantics.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog.concepts b/ChangeLog.concepts index 53face55703..7d3609c08eb 100644 --- a/ChangeLog.concepts +++ b/ChangeLog.concepts @@ -1,3 +1,8 @@ +2013-11-012 Andrew Sutton + * gcc/cp/semantics.c (fixup_template_type): Compare primary template + types to specializations using structural types so we don't run into + canonical type errors with constrained specializations. + 2013-11-08 Andrew Sutton * gcc/cp/pt.c (add_inherited_template_parms): Instantiate requirements in a processing template decl context. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 16ac5a61f22..efd0ae6504b 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -2899,7 +2899,12 @@ fixup_template_type (tree type) while (specs) { tree spec_constr = DECL_CONSTRAINTS (TREE_VALUE (specs)); - if (same_type_p (type, TREE_TYPE (specs)) + + // If the type and constraints match a specialization, then we + // are entering that type. Note that the type comparison is + // structural since constrained partial specialiations may + // have different canonical types for the same type patterns. + if (comptypes (type, TREE_TYPE (specs), COMPARE_STRUCTURAL) && equivalent_constraints (cur_constr, spec_constr)) return TREE_TYPE (specs); specs = TREE_CHAIN (specs); -- 2.11.4.GIT