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

Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu.org

--- Comment #5 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-09-21 21:50:21 UTC ---
This is a very old issue, and there are several PRs open already. It is widely
acknowledged that GCC needs to print the input expression instead of
reconstructing it. But this is (very) hard to fix with current GCC design. See
point A) in

http://gcc.gnu.org/wiki/Better_Diagnostics

and the several PRs mentioned there.

Dodji is working on A.0, and it will probably land on 4.7, but nobody else is
working in any other point there. I started working on A.3 but I got totally
discouraged and gave up.

The only short term solution is to stop printing expressions and let the user
check the source by the location. In fact, this is also part of the long-term
solution, because printing whole expressions in diagnostics is just clutter if
those expressions take several lines. The only fix is to implement caret
diagnostics and avoid expressions in diagnostic messages, like clang does. But
who is going to work on that?


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