What does this mean?
Mike Stump
mrs@windriver.com
Fri Apr 6 14:32:00 GMT 2001
> To: Mike Stump <mrs@windriver.com>
> Cc: gcc@gcc.gnu.org
> From: nbecker@fred.net
> Date: 06 Apr 2001 16:41:49 -0400
> >> In the following diagnostic, why does "(+rng)" mean?
> I don't understand why it says "(+rng)". Why the plus sign?
That's a bug:
case CONVERT_EXPR:
if (VOID_TYPE_P (TREE_TYPE (t)))
{
print_left_paren (scratch_buffer);
dump_type (TREE_TYPE (t), flags);
print_right_paren (scratch_buffer);
dump_expr (TREE_OPERAND (t, 0), flags);
}
else
dump_unary_op ("+", t, flags);
break;
CONVERT_EXPR is not necessarily part of the parse tree, sometimes it
is however. I think it is safe to always remove them. Also, the
parens aren't part of the parse tree. The problem is we dump
partially digested things into error messages.
> Why the paranthesis? I don't think my question is stupid.
Oh, sorry about that, I sometimes read things more literally than
people intend. I answered the question of what does it mean, not why
do the extra characters (+) come out. rng means +rng means (+rng).
The why is more embarrassing, and this embarrassment in conjunction
with my too literal reading is probably why I skipped the why part of
your question.
When dumping unary and binary operators, g++ has a habit of adding ()
to indicate bindings, even when the semantics are clear, and not
present in the source.
More information about the Gcc
mailing list