2012-07-17 Jason Merrill <jason@redhat.com>
+ PR c++/53989
+ * tree.c (build_cplus_array_type): Also add TYPE_CANONICAL
+ to the list of variants.
+
+2012-07-17 Jason Merrill <jason@redhat.com>
+
PR c++/53549
* parser.c (cp_parser_class_head): Call xref_basetypes here.
(cp_parser_class_specifier_1): Not here.
{
tree m = build_cplus_array_type (TYPE_MAIN_VARIANT (elt_type),
index_type);
+ tree c = TYPE_CANONICAL (t);
+
if (TYPE_MAIN_VARIANT (t) != m)
{
TYPE_MAIN_VARIANT (t) = m;
TYPE_NEXT_VARIANT (t) = TYPE_NEXT_VARIANT (m);
TYPE_NEXT_VARIANT (m) = t;
}
+
+ /* If we built a new array type for TYPE_CANONICAL, add
+ that to the list of variants as well. */
+ if (c && c != t && TYPE_MAIN_VARIANT (c) != m)
+ {
+ TYPE_MAIN_VARIANT (c) = m;
+ TYPE_NEXT_VARIANT (c) = t;
+ TYPE_NEXT_VARIANT (m) = c;
+ }
}
/* Push these needs up so that initialization takes place
2012-07-17 Jason Merrill <jason@redhat.com>
+ PR c++/53989
+ * g++.dg/template/array23.C: New.
+
+2012-07-17 Jason Merrill <jason@redhat.com>
+
PR c++/53549
* g++.dg/template/current-inst1.C: New.
* g++.dg/parse/crash35.C: Adjust.