From 024da3094e3bac0ed63bf0955e70557e61fc17f9 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 8 Oct 2014 16:27:11 -0400 Subject: re PR c++/63485 (ICE: canonical types differ for identical types A::type and const char_type [3]) PR c++/63485 * tree.c (build_cplus_array_type): Look for a type with no typedef-name or attributes. From-SVN: r216012 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/tree.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/cp') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c70de7e..975193d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2014-10-08 Jason Merrill + PR c++/63485 + * tree.c (build_cplus_array_type): Look for a type with no + typedef-name or attributes. + * call.c (call_copy_ctor): New. (build_over_call): Use it to avoid infinite recursion on invalid code. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index cfb0ed8..5b11d5c 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -853,7 +853,9 @@ build_cplus_array_type (tree elt_type, tree index_type) { tree m = t; for (t = m; t; t = TYPE_NEXT_VARIANT (t)) - if (TREE_TYPE (t) == elt_type) + if (TREE_TYPE (t) == elt_type + && TYPE_NAME (t) == NULL_TREE + && TYPE_ATTRIBUTES (t) == NULL_TREE) break; if (!t) { -- cgit v1.1