diff options
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r-- | gcc/cp/error.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 381163b2daf..1902a135b89 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -115,7 +115,7 @@ init_error (void) static void dump_scope (tree scope, int flags) { - int f = ~TFF_RETURN_TYPE & (flags & (TFF_SCOPE | TFF_CHASE_TYPEDEF)); + int f = flags & (TFF_SCOPE | TFF_CHASE_TYPEDEF); if (scope == NULL_TREE) return; @@ -865,6 +865,7 @@ dump_simple_decl (tree t, tree type, int flags) pp_maybe_space (cxx_pp); } if (! (flags & TFF_UNQUALIFIED_NAME) + && TREE_CODE (t) != PARM_DECL && (!DECL_INITIAL (t) || TREE_CODE (DECL_INITIAL (t)) != TEMPLATE_PARM_INDEX)) dump_scope (CP_DECL_CONTEXT (t), flags); @@ -945,7 +946,7 @@ dump_decl (tree t, int flags) dump_scope (CP_DECL_CONTEXT (t), flags); flags &= ~TFF_UNQUALIFIED_NAME; if (DECL_NAME (t) == NULL_TREE) - pp_string (cxx_pp, M_("<unnamed>")); + pp_cxx_ws_string (cxx_pp, M_("{anonymous}")); else pp_cxx_tree_identifier (cxx_pp, DECL_NAME (t)); } @@ -1355,6 +1356,7 @@ static void dump_parameters (tree parmtypes, int flags) { int first = 1; + flags &= ~TFF_SCOPE; pp_cxx_left_paren (cxx_pp); for (first = 1; parmtypes != void_list_node; @@ -1388,7 +1390,15 @@ dump_parameters (tree parmtypes, int flags) static void dump_exception_spec (tree t, int flags) { - if (t) + if (t && TREE_PURPOSE (t)) + { + pp_cxx_ws_string (cxx_pp, "noexcept"); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_paren (cxx_pp); + dump_expr (TREE_PURPOSE (t), flags); + pp_cxx_right_paren (cxx_pp); + } + else if (t) { pp_cxx_ws_string (cxx_pp, "throw"); pp_cxx_whitespace (cxx_pp); @@ -1749,7 +1759,9 @@ dump_expr (tree t, int flags) if (TREE_CODE (fn) == OBJ_TYPE_REF) fn = resolve_virtual_fun_from_obj_type_ref (fn); - if (TREE_TYPE (fn) != NULL_TREE && NEXT_CODE (fn) == METHOD_TYPE) + if (TREE_TYPE (fn) != NULL_TREE + && NEXT_CODE (fn) == METHOD_TYPE + && call_expr_nargs (t)) { tree ob = CALL_EXPR_ARG (t, 0); if (TREE_CODE (ob) == ADDR_EXPR) @@ -2116,6 +2128,14 @@ dump_expr (tree t, int flags) pp_cxx_right_paren (cxx_pp); break; + case NOEXCEPT_EXPR: + pp_cxx_ws_string (cxx_pp, "noexcept"); + pp_cxx_whitespace (cxx_pp); + pp_cxx_left_paren (cxx_pp); + dump_expr (TREE_OPERAND (t, 0), flags); + pp_cxx_right_paren (cxx_pp); + break; + case REALPART_EXPR: case IMAGPART_EXPR: pp_cxx_ws_string (cxx_pp, operator_name_info[TREE_CODE (t)].name); |