This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] pr11594


>>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes:

Chris> The value_x_binop() result is checked because binop_user_defined_p()
Chris> only asserts that it's possible for the operands to represent an
Chris> overload, not that there is in fact an overload in this instance.
Chris> That's apparently determined in value_x_binop() and if the operator
Chris> isn't overloaded, I'm defaulting back to non-overloaded behaviour.
Chris> (It seems to me that the language  check ought to be in
Chris> binop_user_defined_p() or binop_types_user_defined_p()--is there ever
Chris> a circumstance other than language_cplus  where you can have
Chris> overloaded operators?)

I don't know of a case.

I couldn't see when value_x_binop can actually return NULL.  It didn't
happen for any of the tests in your .exp.

Another thing to consider are cases like "print 5,x" and "print x,5" in
your test.  These are both valid expressions (g++ accepts them), but
with your patch gdb errors out on at least the first one.

I think your test should also include a test of non-member "operator,".

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]