From 8f56fadc243818bb1b89ac6f53c042d81eb03599 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Mon, 18 May 2015 13:14:04 -0400 Subject: [PATCH] tree.c (strip_typedefs_expr): Fix typo. * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo. (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype. [TREE_LIST]: Fix no-change case. From-SVN: r223300 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/tree.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d4f739c5521..f5a31fde12e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2015-05-18 Jason Merrill + * tree.c (strip_typedefs_expr) [TRAIT_EXPR]: Fix typo. + (strip_typedefs) [DECLTYPE_TYPE]: Fix typedef of decltype. + [TREE_LIST]: Fix no-change case. + * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR. 2015-05-16 Manuel López-Ibáñez diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index ec9be8c2bc4..eebb41544fb 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1265,6 +1265,7 @@ strip_typedefs (tree t, bool *remove_attributes) { bool changed = false; vec *vec = make_tree_vector (); + tree r = t; for (; t; t = TREE_CHAIN (t)) { gcc_assert (!TREE_PURPOSE (t)); @@ -1273,7 +1274,6 @@ strip_typedefs (tree t, bool *remove_attributes) changed = true; vec_safe_push (vec, elt); } - tree r = t; if (changed) r = build_tree_list_vec (vec); release_tree_vector (vec); @@ -1411,7 +1411,7 @@ strip_typedefs (tree t, bool *remove_attributes) result = strip_typedefs_expr (DECLTYPE_TYPE_EXPR (t), remove_attributes); if (result == DECLTYPE_TYPE_EXPR (t)) - return t; + result = NULL_TREE; else result = (finish_decltype_type (result, @@ -1496,8 +1496,8 @@ strip_typedefs_expr (tree t, bool *remove_attributes) && type2 == TRAIT_EXPR_TYPE2 (t)) return t; r = copy_node (t); - TRAIT_EXPR_TYPE1 (t) = type1; - TRAIT_EXPR_TYPE2 (t) = type2; + TRAIT_EXPR_TYPE1 (r) = type1; + TRAIT_EXPR_TYPE2 (r) = type2; return r; } -- 2.30.2