This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/37590] g++ should emit different debug info for variable's type
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Sep 2008 20:48:32 -0000
- Subject: [Bug c++/37590] g++ should emit different debug info for variable's type
- References: <bug-37590-360@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from tromey at gcc dot gnu dot org 2008-09-23 20:48 -------
Jan> Tom, could you elaborate why x1 and x2 should be printed differently?
Jan> I do not say they should not but I do not see a clear reason for either
way.
My view is that "whatis" should print the declared type, as much as possible.
Note that this is a contrived example. Here, it hardly matters. However,
there are many cases where "whatis" shows something incomprehensible
to the user.
Jan> Should we also try to record the source name of this variable?
Jan> #define OBJECT_VAR(object, var) object ## _ ## var
Jan> int OBJECT_VAR (window, width);
Yeah, we can't do a perfect job all the time. We have to print something,
of course, and I suggest using the tokens naming the type (or variable)
after preprocessing -- mostly because that is easy and gets the right
answer when the user does not do cpp tricks.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37590