From d9b147554d6c9f015b79ec09beda789d62a35fc3 Mon Sep 17 00:00:00 2001 From: jason Date: Sun, 17 Mar 2013 02:34:31 +0000 Subject: PR c++/55241 * error.c (dump_expr) [SIZEOF_EXPR]: Print sizeof... properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196726 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/error.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'gcc/cp/error.c') diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c2bf54dcb2c..c3dce1dd5b3 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1783,6 +1783,8 @@ resolve_virtual_fun_from_obj_type_ref (tree ref) static void dump_expr (tree t, int flags) { + tree op; + if (t == 0) return; @@ -2316,14 +2318,20 @@ dump_expr (tree t, int flags) gcc_assert (TREE_CODE (t) == ALIGNOF_EXPR); pp_cxx_ws_string (cxx_pp, "__alignof__"); } + op = TREE_OPERAND (t, 0); + if (PACK_EXPANSION_P (op)) + { + pp_string (cxx_pp, "..."); + op = PACK_EXPANSION_PATTERN (op); + } pp_cxx_whitespace (cxx_pp); pp_cxx_left_paren (cxx_pp); if (TREE_CODE (t) == SIZEOF_EXPR && SIZEOF_EXPR_TYPE_P (t)) - dump_type (TREE_TYPE (TREE_OPERAND (t, 0)), flags); + dump_type (TREE_TYPE (op), flags); else if (TYPE_P (TREE_OPERAND (t, 0))) - dump_type (TREE_OPERAND (t, 0), flags); + dump_type (op, flags); else - dump_expr (TREE_OPERAND (t, 0), flags); + dump_expr (op, flags); pp_cxx_right_paren (cxx_pp); break; -- cgit v1.2.1 From 8e966116ccd5aef7a3965e4375e9ed2384357303 Mon Sep 17 00:00:00 2001 From: rguenth Date: Thu, 21 Mar 2013 11:53:39 +0000 Subject: 2013-03-21 Richard Biener * tree.h (DECL_DEBUG_EXPR_IS_FROM): Rename to ... (DECL_HAS_DEBUG_EXPR_P): ... this. Guard properly. * tree.c (copy_node_stat): Do not copy DECL_HAS_DEBUG_EXPR_P. * dwarf2out.c (add_var_loc_to_decl): Use DECL_HAS_DEBUG_EXPR_P instead of DECL_DEBUG_EXPR_IS_FROM. * gimplify.c (gimplify_modify_expr): Likewise. * tree-cfg.c (verify_expr_location_1): Likewise. * tree-complex.c (create_one_component_var): Likewise. * tree-sra.c (create_access_replacement): Likewise. * tree-ssa-live.c (clear_unused_block_pointer_1): Likewise. (clear_unused_block_pointer): Likewise. * tree-streamer-in.c (unpack_ts_decl_common_value_fields): Likewise. * tree-streamer-out.c (pack_ts_decl_common_value_fields): Likewise. * var-tracking.c (var_debug_decl): Likewise. (track_expr_p): Likewise. * tree-inline.c (add_local_variables): Likewise. Set DECL_HAS_DEBUG_EXPR_P after copying it. * tree-diagnostic.c (default_tree_printer): Use DECL_HAS_DEBUG_EXPR_P instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly. c/ * c-objc-common.c (c_tree_printer): Use DECL_HAS_DEBUG_EXPR_P instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly. cp/ * error.c (cp_printer): Use DECL_HAS_DEBUG_EXPR_P instead of DECL_DEBUG_EXPR_IS_FROM. Guard properly. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196864 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/error.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gcc/cp/error.c') diff --git a/gcc/cp/error.c b/gcc/cp/error.c index c3dce1dd5b3..bcb0274c1b6 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -3283,8 +3283,8 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec, case 'D': { tree temp = next_tree; - if (DECL_P (temp) - && DECL_DEBUG_EXPR_IS_FROM (temp) && DECL_DEBUG_EXPR (temp)) + if (TREE_CODE (temp) == VAR_DECL + && DECL_HAS_DEBUG_EXPR_P (temp)) { temp = DECL_DEBUG_EXPR (temp); if (!DECL_P (temp)) -- cgit v1.2.1