aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-02-13 17:07:30 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-02-13 17:07:30 -0500
commitef796bef889d8a1590430a9da06c40ec4977d79e (patch)
treea3d3d0ff70776f75d1e90655b7d95c53b16ab059 /gcc/cp/tree.c
parent8f895cf1ac7babe0c89533e8e9e6b6ca6bb33950 (diff)
downloadgcc-ef796bef889d8a1590430a9da06c40ec4977d79e.zip
gcc-ef796bef889d8a1590430a9da06c40ec4977d79e.tar.gz
gcc-ef796bef889d8a1590430a9da06c40ec4977d79e.tar.bz2
re PR c++/65054 (internal compiler error: in maybe_constant_value, at cp/constexpr.c:3646)
PR c++/65054 * pt.c (template_args_equal): Look through conversions here. * tree.c (cp_tree_equal): Not here. From-SVN: r220697
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index c51e42d..c8e6f0c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2745,20 +2745,8 @@ cp_tree_equal (tree t1, tree t2)
if (!t1 || !t2)
return false;
- for (code1 = TREE_CODE (t1);
- CONVERT_EXPR_CODE_P (code1)
- || code1 == NON_LVALUE_EXPR;
- code1 = TREE_CODE (t1))
- t1 = TREE_OPERAND (t1, 0);
- for (code2 = TREE_CODE (t2);
- CONVERT_EXPR_CODE_P (code2)
- || code2 == NON_LVALUE_EXPR;
- code2 = TREE_CODE (t2))
- t2 = TREE_OPERAND (t2, 0);
-
- /* They might have become equal now. */
- if (t1 == t2)
- return true;
+ code1 = TREE_CODE (t1);
+ code2 = TREE_CODE (t2);
if (code1 != code2)
return false;
@@ -2996,6 +2984,9 @@ cp_tree_equal (tree t1, tree t2)
case DYNAMIC_CAST_EXPR:
case IMPLICIT_CONV_EXPR:
case NEW_EXPR:
+ CASE_CONVERT:
+ case NON_LVALUE_EXPR:
+ case VIEW_CONVERT_EXPR:
if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return false;
/* Now compare operands as usual. */