diff options
Diffstat (limited to 'gcc/cp/tree.cc')
-rw-r--r-- | gcc/cp/tree.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc index bc38c8fbdbe..09162795801 100644 --- a/gcc/cp/tree.cc +++ b/gcc/cp/tree.cc @@ -2901,7 +2901,11 @@ bind_template_template_parm (tree t, tree newargs) TYPE_NAME (t2) = decl; TYPE_STUB_DECL (t2) = decl; TYPE_SIZE (t2) = 0; - SET_TYPE_STRUCTURAL_EQUALITY (t2); + + if (any_template_arguments_need_structural_equality_p (newargs)) + SET_TYPE_STRUCTURAL_EQUALITY (t2); + else + TYPE_CANONICAL (t2) = canonical_type_parameter (t2); return t2; } |