[cfe-dev] Location for plausible overloads in diagnostic

Douglas Gregor dgregor at apple.com
Tue Nov 15 11:33:02 PST 2011


On Nov 15, 2011, at 10:44 AM, Abramo Bagnara wrote:

> 
> There is some reason to use getLocStart() instead of getLocation() in
> noteOverloads function in Sema.cpp?
> 
> Sema.cpp:971:    S.Diag(Fn->getLocStart(),
> diag::note_possible_target_of_call);
> 
> After the recent changes the output is now:
> 
> $ clang++ -c w.cc
> w.cc:5:3: error: reference to overloaded function could not be resolved;
> did you
>      mean to call it?
>  &foo;
>  ^~~~
> w.cc:4:1: note: possible target for call
> void foo(int) {
> ^
> w.cc:2:1: note: possible target for call
> void foo(double);
> ^
> 1 error generated.
> 
> Can I fix it or there are non obvious reasons for this choice?

Please go ahead and fix it, thanks!

	- Doug




More information about the cfe-dev mailing list