[Bug c++/62170] wrong quoting (and colors) for typedef diagnostics

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Aug 18 13:51:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62170

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dodji at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
It is not clear how to fix this. At the point the "aka" part is emitted, we
don't know whether we are within quotes. 

Perhaps the pretty-printer should allow the language-specific formatting
function to modify the formatting string somehow:

"%qT" is passed to the pretty-printer, which starts printing "`", then calls
the c++ formatter which handles the %T part but also modifies the original
format to "%qT (aka %qX)". Then, the formatter will get called again for %qX
but with the original type.

How to pass the info to the pretty-printer doesn't seem trivial. Maybe
modifying the obstacks would be enough...

Ideas welcome!


More information about the Gcc-bugs mailing list