This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49152] Unhelpful diagnostic for iterator dereference
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 21 Sep 2011 21:03:37 +0000
- Subject: [Bug c++/49152] Unhelpful diagnostic for iterator dereference
- Auto-submitted: auto-generated
- References: <bug-49152-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49152
--- 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
sizeof(*x))