public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22558] New: __func__ and __FUNCTION__ are wrong for destructors
@ 2005-07-19 13:34 andyparkins at gmail dot com
  2005-07-19 13:37 ` [Bug c++/22558] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: andyparkins at gmail dot com @ 2005-07-19 13:34 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/22558] __func__ and __FUNCTION__ are wrong for destructors
  2005-07-19 13:34 [Bug c++/22558] New: __func__ and __FUNCTION__ are wrong for destructors andyparkins at gmail dot com
@ 2005-07-19 13:37 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-19 13:37 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-19 13:34 -------
Fixed for 3.4.0 by:
2003-09-04  Matt Austern  <austern@apple.com>
        
        * c-common.c (fname_as_string): Use lang_hooks.decl_printable_name
        with verbosity 0, instead of DECL_NAME, for human-readable string.

http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00225.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22558


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-07-19 13:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-19 13:34 [Bug c++/22558] New: __func__ and __FUNCTION__ are wrong for destructors andyparkins at gmail dot com
2005-07-19 13:37 ` [Bug c++/22558] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).