This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]