Re: [RFC] improve caret diagnostics for overload failures

2012-05-09 Thread Manuel López-Ibáñez
Someone opened a bug about this: http://gcc.gnu.org/PR53289 Pinging: http://gcc.gnu.org/ml/gcc-patches/2012-04/msg01836.html On 29 April 2012 12:28, Manuel López-Ibáñez lopeziba...@gmail.com wrote: A new  version using unsigned int for the flag type. It also adds another use in the C FE. I

Re: [RFC] improve caret diagnostics for overload failures

2012-05-09 Thread Jason Merrill
On 04/29/2012 06:28 AM, Manuel López-Ibáñez wrote: A new version using unsigned int for the flag type. It also adds another use in the C FE. I am not asking for approval, only whether this approach/implementation is the way to go. That looks good. I would still also adjust the caret printer

Re: [RFC] improve caret diagnostics for overload failures

2012-05-09 Thread Manuel López-Ibáñez
On 9 May 2012 15:04, Jason Merrill ja...@redhat.com wrote: On 04/29/2012 06:28 AM, Manuel López-Ibáńez wrote: A new  version using unsigned int for the flag type. It also adds another use in the C FE. I am not asking for approval, only whether this approach/implementation is the way to go.

Re: [RFC] improve caret diagnostics for overload failures

2012-05-09 Thread Jason Merrill
On 05/09/2012 09:07 AM, Manuel López-Ibáñez wrote: I could implement that by storing the last location in the diagnostic_context or using a static location_t in diagnostic_show_locus. What is your preference? diagnostic_context, I guess. Jason

Re: [RFC] improve caret diagnostics for overload failures

2012-04-29 Thread Manuel López-Ibáñez
A new version using unsigned int for the flag type. It also adds another use in the C FE. I am not asking for approval, only whether this approach/implementation is the way to go. Cheers, Manuel. On 23 April 2012 20:09, Manuel López-Ibáñez lopeziba...@gmail.com wrote: So, apart from the type

Re: [RFC] improve caret diagnostics for overload failures

2012-04-23 Thread Manuel López-Ibáñez
So, apart from the type of the flag, are there any other comments on the patch? Is the approach acceptable? On 21 April 2012 17:51, Gabriel Dos Reis g...@integrable-solutions.net wrote: On Sat, Apr 21, 2012 at 9:42 AM, Jakub Jelinek ja...@redhat.com wrote: On Sat, Apr 21, 2012 at 04:26:32PM

[RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Manuel López-Ibáñez
As noticed by Jason in PR 2485. The current output with caret diagnostics is a bit verbose in some cases: wa2.C: In function ‘int main()’: wa2.C:6:6: error: no matching function for call to ‘f(int)’ f(1); ^ wa2.C:6:6: note: candidates are: f(1); ^ wa2.C:1:6: note: void f() void

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Gabriel Dos Reis
Do no use 'char' as the type of a flag. Prefer 'unsigned int'. On Sat, Apr 21, 2012 at 8:57 AM, Manuel López-Ibáñez lopeziba...@gmail.com wrote: As noticed by Jason in PR 2485. The current output with caret diagnostics is a bit verbose in some cases: wa2.C: In function ‘int main()’:

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Manuel López-Ibáñez
On 21 April 2012 16:22, Gabriel Dos Reis g...@integrable-solutions.net wrote: Do no use 'char' as the type of a flag.  Prefer 'unsigned int'. Thanks, good catch! Should I worry about memory here and use something shorter? Cheers, Manuel.

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Jakub Jelinek
On Sat, Apr 21, 2012 at 04:26:32PM +0200, Manuel López-Ibáñez wrote: On 21 April 2012 16:22, Gabriel Dos Reis g...@integrable-solutions.net wrote: Do no use 'char' as the type of a flag.  Prefer 'unsigned int'. Thanks, good catch! Should I worry about memory here and use something

Re: [RFC] improve caret diagnostics for overload failures

2012-04-21 Thread Gabriel Dos Reis
On Sat, Apr 21, 2012 at 9:42 AM, Jakub Jelinek ja...@redhat.com wrote: On Sat, Apr 21, 2012 at 04:26:32PM +0200, Manuel López-Ibáñez wrote: On 21 April 2012 16:22, Gabriel Dos Reis g...@integrable-solutions.net wrote: Do no use 'char' as the type of a flag.  Prefer 'unsigned int'.