diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-26 13:09:58 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-02-26 13:09:58 +0000 |
commit | b8053af55de78a3f080783e5113fd6452e5a43c5 (patch) | |
tree | a5906142e844e296abb7382e34657faf4e58f74f /gcc/cp/cxx-pretty-print.c | |
parent | 4896274c9597b09d4c61bdd2efb3201a72634b3c (diff) | |
download | gcc-b8053af55de78a3f080783e5113fd6452e5a43c5.tar.gz |
2008-02-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r132671
Merged revisions 132452-132671 via svnmerge from
svn+ssh://bstarynk@gcc.gnu.org/svn/gcc/trunk
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@132672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cxx-pretty-print.c')
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 9c5a85ff0b4..62ff1fc3fc3 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -1,5 +1,5 @@ /* Implementation of subroutines for the GNU C++ pretty-printer. - Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net> This file is part of GCC. @@ -636,6 +636,8 @@ static void pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) { enum tree_code code = TREE_CODE (t); + tree type = TREE_OPERAND (t, 1); + tree init = TREE_OPERAND (t, 2); switch (code) { case NEW_EXPR: @@ -648,18 +650,22 @@ pp_cxx_new_expression (cxx_pretty_printer *pp, tree t) pp_cxx_call_argument_list (pp, TREE_OPERAND (t, 0)); pp_space (pp); } - /* FIXME: array-types are built with one more element. */ - pp_cxx_type_id (pp, TREE_OPERAND (t, 1)); - if (TREE_OPERAND (t, 2)) + if (TREE_CODE (type) == ARRAY_REF) + type = build_cplus_array_type + (TREE_OPERAND (type, 0), + build_index_type (fold_build2 (MINUS_EXPR, integer_type_node, + TREE_OPERAND (type, 1), + integer_one_node))); + pp_cxx_type_id (pp, type); + if (init) { pp_left_paren (pp); - t = TREE_OPERAND (t, 2); - if (TREE_CODE (t) == TREE_LIST) - pp_c_expression_list (pp_c_base (pp), t); - else if (t == void_zero_node) + if (TREE_CODE (init) == TREE_LIST) + pp_c_expression_list (pp_c_base (pp), init); + else if (init == void_zero_node) ; /* OK, empty initializer list. */ else - pp_cxx_expression (pp, t); + pp_cxx_expression (pp, init); pp_right_paren (pp); } break; |