This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __func__ and C++


On Sep 3, 2003, at 12:12 PM, Paul Koning wrote:

Leaving it alone for the most part makes sense. but I see no way to
justify "~foo" being reported as "foo".  That's clearly a bug.

I wouldn't like to see major changes in __func__: at the moment it doesn't include a type signature or a mangled name or scope qualification, and users seem to be mostly happy with that. But users aren't happy with the fact that foo::~foo()'s name is reported as "foo". They think that's at best counterintuitive, and I have to agree.


I've poked through the code a bit, and I think the problem is that fname_as_string() just returns whatever was stored in DECL_NAME. I think that's a bug. It's not the right way of getting a useful human-readable string. Sometimes you'll get lucky and find that you get one, sometimes you won't. The documented way of getting a short human-readable representation of a decl's name is to use lang_hooks.decl_printable_name with verbosity 0. I'll work up the patch and make sure it does something reasonable, and then submit it.

--Matt

P.S. Sorry about your getting this mail again, Nathan. I tried to send it before, and just noticed that I sent it to you only instead of to the whole list.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]