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: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Mar 2012 11:37:17 +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 #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.