http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45333
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2011-10-20 CC| |manu at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-10-20 08:32:40 UTC --- With -ftrack-macro-expansion we get: pr45333.cc: In instantiation of ‘void C<T>::set(int) [with T = S]’: pr45333.cc:1:24: required from here pr45333.cc:15:21: error: no match for ‘operator=’ in ‘((C<S>*)this)->C<S>::t = x’ pr45333.cc:15:21: note: candidate is: pr45333.cc:3:8: note: S& S::operator=(const S&) pr45333.cc:3:8: note: no known conversion for argument 1 from ‘int’ to ‘const S&’ So we can track the origin of the instantation to the macro definition, but then we don't show where the macro is invoked from, which is shown without -ftrack-macro-expansion. I think it should show both, like clang does: pr45333.cc: In instantiation of ‘void C<T>::set(int) [with T = S]’: pr45333.cc:1:19: instantiated from macro ZERO pr45333.cc:20:3: required from here pr45333.cc:15:21: error: no match for ‘operator=’ in ‘((C<S>*)this)->C<S>::t = x’ pr45333.cc:15:21: note: candidate is: pr45333.cc:3:8: note: S& S::operator=(const S&) pr45333.cc:3:8: note: no known conversion for argument 1 from ‘int’ to ‘const S&’ Notice that in my ideal output, I also fixed the location given for the first instantation to point to "set" (1:19) and not to the end of the line (1:24).