------- Comment #16 from hjl dot tools at gmail dot com 2010-02-15 16:44 ------- I have no idea if this patch makes any senses:
--- diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index d2ab4f0..5ac5f09 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -822,7 +822,7 @@ cp_build_qualified_type_real (tree type, { t = build_cplus_array_type_1 (element_type, TYPE_DOMAIN (type)); - if (TYPE_MAIN_VARIANT (t) != TYPE_MAIN_VARIANT (type)) + if (!same_type_ignoring_top_level_qualifiers_p (t, type)) { /* Set the main variant of the newly-created ARRAY_TYPE (with cv-qualified element type) to the main variant of --- -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43036