Commit 19948e32 by Gabriel Dos Reis Committed by Gabriel Dos Reis

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
parent c18b00c0
2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
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 <gdr@integrable-solutions.net>
* error.c (dump_expr): Handle EMPTY_CLASS_EXPR. * error.c (dump_expr): Handle EMPTY_CLASS_EXPR.
2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net> 2003-07-14 Gabriel Dos Reis <gdr@integrable-solutions.net>
......
...@@ -3010,6 +3010,11 @@ op_error (enum tree_code code, enum tree_code code2, ...@@ -3010,6 +3010,11 @@ op_error (enum tree_code code, enum tree_code code2,
case ARRAY_REF: case ARRAY_REF:
error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2); error ("%s for 'operator[]' in '%E[%E]'", problem, arg1, arg2);
break; break;
case REALPART_EXPR:
case IMAGPART_EXPR:
error ("%s for '%s' in '%s %E'", problem, opname, opname, arg1);
break;
default: default:
if (arg2) if (arg2)
......
...@@ -1982,6 +1982,14 @@ dump_expr (tree t, int flags) ...@@ -1982,6 +1982,14 @@ dump_expr (tree t, int flags)
print_right_paren (scratch_buffer); print_right_paren (scratch_buffer);
break; 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: case DEFAULT_ARG:
print_identifier (scratch_buffer, "<unparsed>"); print_identifier (scratch_buffer, "<unparsed>");
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment