This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH] Last canonical type fix for arrays
- From: "Doug Gregor" <doug dot gregor at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 24 Sep 2007 09:51:10 -0400
- Subject: [C++ PATCH] Last canonical type fix for arrays
A recently-provided test case for PR 33185 illustrated one last tiny
problem with the handling of canonical types for typedef'd arrays to
cv-qualified types. This one-liner handles this case appropriately.
Tested i686-pc-linux-gnu, committed as obvious.
- Doug
2007-09-24 Douglas Gregor <doug.gregor@gmail.com>
PR c++/33185
* tree.c (cp_build_qualified_type_real): Build a canonical
ARRAY_TYPE if the original ARRAY_TYPE was not a canonical type.
Index: tree.c
===================================================================
--- tree.c (revision 128711)
+++ tree.c (working copy)
@@ -738,7 +738,8 @@ cp_build_qualified_type_real (tree type,
SET_TYPE_STRUCTURAL_EQUALITY (t);
else if (TYPE_CANONICAL (element_type) != element_type
|| (index_type
- && TYPE_CANONICAL (index_type) != index_type))
+ && TYPE_CANONICAL (index_type) != index_type)
+ || TYPE_CANONICAL (type) != type)
TYPE_CANONICAL (t)
= build_cplus_array_type
(TYPE_CANONICAL (element_type),