[Bug c++/49152] Unhelpful diagnostic for iterator dereference

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 21 23:31:00 GMT 2011


--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-09-21 21:03:37 UTC ---
The common thing in my original example and comment 2 is that when printing "no
match" for a binary operator, the diagnostic machinery tries to "reconstruct"
the left operand, but produces a poor result if that left operand is itself the
result of an operator expression

e.g. in my case *first gets "reconstructed" to first.foo::operator*
(while technically equivalent, noone would write the latter)

in comment 2 x[1] gets "reconstructed" to *(x + 4)
(not even equivalent, the reconstruction has forgotten to divide the offset by

More information about the Gcc-bugs mailing list