From: Jason Merrill Date: Fri, 3 Oct 2014 15:52:03 +0000 (-0400) Subject: re PR c++/63362 (The c++11 triviality-traits need front-end help) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2bd8ca2100715c6a8b1f7fa1288cf3166898e1fd;p=gcc.git 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 --- 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: