aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-02-09 15:39:13 -0500
committerJason Merrill <jason@gcc.gnu.org>2013-02-09 15:39:13 -0500
commit25976b7f5db1a648cb9a6d5ec389eb2706189421 (patch)
tree3af11142b110b4f44702d237e207200670573e4e /gcc/cp/tree.c
parent8d40d877c01a2ab5ad2350cdc284660b36618f95 (diff)
downloadgcc-25976b7f5db1a648cb9a6d5ec389eb2706189421.zip
gcc-25976b7f5db1a648cb9a6d5ec389eb2706189421.tar.gz
gcc-25976b7f5db1a648cb9a6d5ec389eb2706189421.tar.bz2
re PR c++/56247 (internal compiler error: in tsubst_copy, at cp/pt.c:12131)
PR c++/56247 * pt.c (eq_specializations): Set comparing_specializations. * tree.c (cp_tree_equal): Check it. * cp-tree.h: Declare it. From-SVN: r195922
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 18d9a98..0b033c2 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2580,6 +2580,13 @@ cp_tree_equal (tree t1, tree t2)
with an out-of-class definition of the function, but can also come
up for expressions that involve 'this' in a member function
template. */
+
+ if (comparing_specializations)
+ /* When comparing hash table entries, only an exact match is
+ good enough; we don't want to replace 'this' with the
+ version from another function. */
+ return false;
+
if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
{
if (DECL_ARTIFICIAL (t1) ^ DECL_ARTIFICIAL (t2))