From 19948e32a8be1a439f58c2d34a7f0b03ec03b85c Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Mon, 14 Jul 2003 17:45:08 +0000 Subject: re PR c++/11510 (Error message with operator __imag__ is missing spaces) PR c++/11510 * call.c (op_error): Properly handle REALPART_EXPR and IMAGPART_EXPR. * error.c (dump_expr): Likewise. From-SVN: r69340 --- gcc/cp/ChangeLog | 7 +++++++ gcc/cp/call.c | 5 +++++ gcc/cp/error.c | 8 ++++++++ 3 files changed, 20 insertions(+) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f62013d..8318b91 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,12 @@ 2003-07-14 Gabriel Dos Reis + PR c++/11510 + * call.c (op_error): Properly format REALPART_EXPR and + IMAGPART_EXPR. + * error.c (dump_expr): Likewise. + +2003-07-14 Gabriel Dos Reis + * error.c (dump_expr): Handle EMPTY_CLASS_EXPR. 2003-07-14 Gabriel Dos Reis diff --git a/gcc/cp/call.c b/gcc/cp/call.c index c71b3f8..bd947f7 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3010,6 +3010,11 @@ op_error (enum tree_code code, enum tree_code code2, case ARRAY_REF: error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2); break; + + case REALPART_EXPR: + case IMAGPART_EXPR: + error ("%s for '%s' in '%s %E'", problem, opname, opname, arg1); + break; default: if (arg2) diff --git a/gcc/cp/error.c b/gcc/cp/error.c index 1fc4047..b9bc9b2 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -1982,6 +1982,14 @@ dump_expr (tree t, int flags) print_right_paren (scratch_buffer); break; + case REALPART_EXPR: + case IMAGPART_EXPR: + print_identifier (scratch_buffer, + operator_name_info[TREE_CODE (t)].name); + output_add_space (scratch_buffer); + dump_expr (TREE_OPERAND (t, 0), flags); + break; + case DEFAULT_ARG: print_identifier (scratch_buffer, ""); break; -- cgit v1.1