This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45333] Include macros in instantiation backtraces
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 20 Oct 2011 08:32:40 +0000
- Subject: [Bug c++/45333] Include macros in instantiation backtraces
- Auto-submitted: auto-generated
- References: <bug-45333-4@http.gcc.gnu.org/bugzilla/>
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).