[C++ PATCH] Canonical type fixes for arrays of cv-qualified vectors (PR c++/35113)
H.J. Lu
hjl.tools@gmail.com
Sun Feb 14 01:25:00 GMT 2010
On Thu, Feb 7, 2008 at 10:54 AM, Doug Gregor <doug.gregor@gmail.com> wrote:
> The new test g++.dg/ext/vector13.C, which came in through PR
> c++/35096, is currently failing on mainline. This is a 4.3 regression
> due to the canonical types system, where we are failing to properly
> deal with certain cv-qualified array types, in particular, those that
> are arrays of vectors. This patch fixes the problem by simplifying the
> C++ code that builds qualified array types: instead of duplicating the
> logic of build_cplus_array_type_1, we reuse build_cplus_array_type_1
> to build the new array type, then link up the main variants of the
> newly-built cv-qualified type and the original (unqualified) array
> type. Without this fix, we could end up building two cv-qualified
> array nodes from different hash tables: one stored in the C/C++ common
> hash table (via type_hash_canon) and one maintained by
> build_cplus_array_type (that was intended deal only with dependent
> types). In retrospect, this is the obvious implementation.
>
> Tested i686-pc-linux-gnu and i386-apple-darwin9.1.0. Okay for mainline?
>
> - Doug
>
> 2008-02-07 Douglas Gregor <doug.gregor@gmail.com>
>
> PR c++/35113
> * tree.c (cp_build_qualified_type_real): When building a
> cv-qualified array type, build it as a unique type with
> build_cplus_array_type_1 and then adopt the unqualified type's
> main variant.
>
This patch caused:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43036
--
H.J.
More information about the Gcc-patches
mailing list