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: Mon, 02 Apr 2012 17:15:47 +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 #33 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2012-04-02 17:15:47 UTC ---
(In reply to comment #32)
> (In reply to comment #31)
> > Well, that is reassuring. Then, will we still pretty-print expressions in
> > diagnostics once we have the caret?
>
> No, there should be no need to.
As a first minimal step, would a first patch be enough that simply:
* Adds an option to disable/enable the caret? By default on if(isatty),
otherwise off.
* Implements the caret by reopening the file, looks for the appropriate line,
and prints this line, then prints a '^' below it using the column info.
Of course this may fail in some cases, like non-ANSI input, and not
preprocessing, but it will work in 99% of the cases. In any case, it is not
clear to me that we want to print the preprocessed line instead of the original
text.