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

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 22 11:38:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49152

--- Comment #15 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-03-22 11:37:17 UTC ---
(In reply to comment #13)
> Please don't close this as a dup of the caret diagnostics PR.
> 
> I agree there's no consensus on what should be done, but printing of

I only know of one dissenting opinion. What does Jason and Benjamin think about
it? A dissenting opinion has been overridden before and the sky didn't fall.

> Re Gaby's point about the error appearing in a sub-expression of a larger full
> expression, that's true, but the current behaviour doesn't help. The message 

I think it is a red herring. Any IDE, including emacs, will show the location
of the error in the source. So as long as the location is right, it is more
clear to not print anything than to print a *different* expression. That is,
even without caret, it is better to not print the expression if the expression
is not *exactly* the one appearing in the code. 

The only people that are helped by the current behavior are those that
understand what 'first.__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator*' means. See comment #6 and cry.



More information about the Gcc-bugs mailing list