both __func__ and __FUNCTION__ don't include the tilde when used from a
destructor. __PRETTY_FUNCTION__ does include the tilde.
So,
class Test {
public:
Test() { cerr << __func __ << endl; }
~Test() { cerr << __func__ << endl; }
};
When constructing and destructing "Test" is output, when it should be "Test" and
"~Test".
In case it's needed:
Reading specs from /usr/lib/gcc-lib/i486-linux-gnu/3.3.6/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
--enable-__cxa_atexit --with-system-zlib --enable-nls --without-included-gettext
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i486-linux-gnu
Thread model: posix
gcc version 3.3.6 (Debian 1:3.3.6-7)
--
Summary: __func__ and __FUNCTION__ are wrong for destructors
Product: gcc
Version: 3.3.6
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andyparkins at gmail dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22558