[cfe-dev] Location for plausible overloads in diagnostic

Abramo Bagnara abramo.bagnara at gmail.com
Tue Nov 15 10:44:06 PST 2011


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?



More information about the cfe-dev mailing list