This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __func__ and C++
- From: Joe Buck <jbuck at synopsys dot com>
- To: Matt Austern <austern at apple dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 2 Sep 2003 17:46:25 -0700
- Subject: Re: __func__ and C++
- References: <B7AE02D8-DD72-11D7-8814-000393B2ABA2@apple.com>
On Tue, Sep 02, 2003 at 11:24:40AM -0700, Matt Austern wrote:
> Inside a destructor, __func__ and __FUNCTION__ return "foo", not
> "~foo". (__PRETTY_FUNCTION__ behaves the way I would expect.)
>
> Is this behavior intended, or is it a bug? The gcc manual merely says
> that __func__ is supposed to return the function's name without a type
> signature, and doesn't say what that's supposed to mean in the case of
> special C++ functions. Since __func__ in C++ is a gcc extension, none
> of the language standards provide any useful guidance.
Reading the document, I would expect "without a type signature" to mean
that the string does not include the return type or the argument types,
but I would still expect to see "~foo" rather than "foo", or "operator=="
or similar. Of course, since it's an extension, it is arbitrary.