Commit 8f56fadc by Jason Merrill Committed by Jason Merrill

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
parent 80f1c14d
2015-05-18 Jason Merrill <jason@redhat.com> 2015-05-18 Jason Merrill <jason@redhat.com>
* 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. * ptree.c (cxx_print_xnode): Handle TRAIT_EXPR.
2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org> 2015-05-16 Manuel López-Ibáñez <manu@gcc.gnu.org>
......
...@@ -1265,6 +1265,7 @@ strip_typedefs (tree t, bool *remove_attributes) ...@@ -1265,6 +1265,7 @@ strip_typedefs (tree t, bool *remove_attributes)
{ {
bool changed = false; bool changed = false;
vec<tree,va_gc> *vec = make_tree_vector (); vec<tree,va_gc> *vec = make_tree_vector ();
tree r = t;
for (; t; t = TREE_CHAIN (t)) for (; t; t = TREE_CHAIN (t))
{ {
gcc_assert (!TREE_PURPOSE (t)); gcc_assert (!TREE_PURPOSE (t));
...@@ -1273,7 +1274,6 @@ strip_typedefs (tree t, bool *remove_attributes) ...@@ -1273,7 +1274,6 @@ strip_typedefs (tree t, bool *remove_attributes)
changed = true; changed = true;
vec_safe_push (vec, elt); vec_safe_push (vec, elt);
} }
tree r = t;
if (changed) if (changed)
r = build_tree_list_vec (vec); r = build_tree_list_vec (vec);
release_tree_vector (vec); release_tree_vector (vec);
...@@ -1411,7 +1411,7 @@ strip_typedefs (tree t, bool *remove_attributes) ...@@ -1411,7 +1411,7 @@ strip_typedefs (tree t, bool *remove_attributes)
result = strip_typedefs_expr (DECLTYPE_TYPE_EXPR (t), result = strip_typedefs_expr (DECLTYPE_TYPE_EXPR (t),
remove_attributes); remove_attributes);
if (result == DECLTYPE_TYPE_EXPR (t)) if (result == DECLTYPE_TYPE_EXPR (t))
return t; result = NULL_TREE;
else else
result = (finish_decltype_type result = (finish_decltype_type
(result, (result,
...@@ -1496,8 +1496,8 @@ strip_typedefs_expr (tree t, bool *remove_attributes) ...@@ -1496,8 +1496,8 @@ strip_typedefs_expr (tree t, bool *remove_attributes)
&& type2 == TRAIT_EXPR_TYPE2 (t)) && type2 == TRAIT_EXPR_TYPE2 (t))
return t; return t;
r = copy_node (t); r = copy_node (t);
TRAIT_EXPR_TYPE1 (t) = type1; TRAIT_EXPR_TYPE1 (r) = type1;
TRAIT_EXPR_TYPE2 (t) = type2; TRAIT_EXPR_TYPE2 (r) = type2;
return r; return r;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment