Removing unspecified template parameters from error messages

Gabriel Dos Reis gdr@cs.tamu.edu
Fri Oct 29 16:47:00 GMT 2004


Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr> writes:

| Hi, since the topic was raised again last week, I tried to give a try 
| at allowing gcc not to display the default template parameters when 
| the defaults are in usage (ie when the user has not specified the 
| argument). I'm not sure how an improvement it will be, but decided it 
| was worth to try....
| 
| I think I made some progress toward such a goal (even though I'm sure 
| that my first trial would need many corrections): I think I now mark 
| correctly the arguments that were not specified.
| 
| Actually, the biggest problem I encounter is with the diagnostic 
| machinery which does not propagate the proper information to the
| function that displays a template class type (in this case it might
| be just the number of template parameters to display or the args tree).
| 
| Solving this with minimal modifications require having a global variable
| (this is what I may use to get first results), but this is rather ugly...

Where are you making the changes?  In cp/error.c?  I think
cp/cxx-pretty-print.c is a better place, as it allows for more
information to flow in properly and naturally.

| Would it be acceptable to replace the curreny flag parameter with sthg
| slightly more complicated in all the diagnostic routines: eg a struct 
| that conveys the actual flag + some "user data" (eg depending on the 
| flag). This seems to be an overkill for one just little added value, 
| however it might also be of some use elsewhere. I have not checked 
| and do not know the diagnostic well enough yet.

cxx_pretty_printer has a flag, pp_c_base(pp)->flags, that you can use
to add more meaningful information.  You might want to augment
cxx_pretty_printer itself with such information that cannot fit into
the enumeration. 

-- Gaby



More information about the Gcc mailing list