aboutsummaryrefslogtreecommitdiff
path: root/gcc/system.h
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-06-18 05:45:02 -0400
committerJason Merrill <jason@redhat.com>2022-05-06 16:34:51 -0400
commit69dd5ca3484ee514c1323dfbcf4ef4358cea57bb (patch)
tree977459ac84579eac53c159e7d22f2e957bcf793a /gcc/system.h
parente4e053a63b153039a7905901806a4f4a3154988b (diff)
downloadgcc-69dd5ca3484ee514c1323dfbcf4ef4358cea57bb.zip
gcc-69dd5ca3484ee514c1323dfbcf4ef4358cea57bb.tar.gz
gcc-69dd5ca3484ee514c1323dfbcf4ef4358cea57bb.tar.bz2
c++: add color to function decl printing
In reading C++ diagnostics, it's often hard to find the name of the function in the middle of the template header, return type, parameters, and template arguments. So let's colorize it, and maybe the template argument bindings while we're at it. I've somewhat arbitrarily chosen bold green for the function name, and non-bold magenta for the template arguments. A side-effect of this is that when this happens in a quote (i.e. %qD), the rest of the quote after the function name is no longer bold. I think that's acceptable; returning to the bold would require maintaining a colorize stack instead of the on/off controls we have now. gcc/cp/ChangeLog: * error.cc (decl_to_string): Add show_color parameter. (subst_to_string): Likewise. (cp_printer): Pass it. (type_to_string): Set pp_show_color. (dump_function_name): Use "fnname" color. (dump_template_bindings): Use "targs" color. (struct colorize_guard): New. (reinit_cxx_pp): Clear pp_show_color. gcc/ChangeLog: * diagnostic-color.cc: Add fnname and targs color entries. * doc/invoke.texi: Document them. gcc/testsuite/ChangeLog: * g++.dg/diagnostic/function-color1.C: New test.
Diffstat (limited to 'gcc/system.h')
0 files changed, 0 insertions, 0 deletions