From 2bd8ca2100715c6a8b1f7fa1288cf3166898e1fd Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 3 Oct 2014 11:52:03 -0400 Subject: [PATCH] re PR c++/63362 (The c++11 triviality-traits need front-end help) PR c++/63362 * tree.c (strip_typedefs): Handle TREE_LIST. From-SVN: r215860 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/tree.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 80ed468ab5c..4f91a68824b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-10-03 Jason Merrill + + PR c++/63362 + * tree.c (strip_typedefs): Handle TREE_LIST. + 2014-10-03 Paolo Carlini * parser.c (cp_parser_assignment_expression, diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 2247eb5baa8..316c8ff8d40 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -1201,11 +1201,33 @@ strip_typedefs (tree t) { tree result = NULL, type = NULL, t0 = NULL; - if (!t || t == error_mark_node || t == TYPE_CANONICAL (t)) + if (!t || t == error_mark_node) return t; + if (TREE_CODE (t) == TREE_LIST) + { + bool changed = false; + vec *vec = make_tree_vector (); + for (; t; t = TREE_CHAIN (t)) + { + gcc_assert (!TREE_PURPOSE (t)); + tree elt = strip_typedefs (TREE_VALUE (t)); + if (elt != TREE_VALUE (t)) + changed = true; + vec_safe_push (vec, elt); + } + tree r = t; + if (changed) + r = build_tree_list_vec (vec); + release_tree_vector (vec); + return r; + } + gcc_assert (TYPE_P (t)); + if (t == TYPE_CANONICAL (t)) + return t; + switch (TREE_CODE (t)) { case POINTER_TYPE: -- 2.30.2