http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53822

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #4)
> Created attachment 31564 [details]
> patch
> 
> (mostly untested)
> 
> This changes the message to:
> error: call of overloaded 'f(NT&)' {aka 'f(unsigned int&)'} is ambiguous
> 
> As far as I can tell, "%#A" is unused, so it seems ok to hijack it.
> 
> It isn't very nice because without typedefs it will repeat the same thing
> twice, but printing [with NT=unsigned int] seems more complicated to me.

There is code in error.c:type_to_string to print "{aka ". It does some tricks
to avoid printing aka when there are no typedefs. Perhaps args_to_string()
should call type_to_string() instead of calling dump_type directly. With that,
it prints:


test.cc:6:6: error: call of overloaded ‘f(NT& {aka unsigned int&})’ is
ambiguous

I am not sure if that is clearer or not. But it avoids the repetition.

Reply via email to