public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11355] New: compilation involving static class members is affected by the presence of virtual destructor
@ 2003-06-28  0:31 mohit_aron at hotmail dot com
  2003-06-28  1:30 ` [Bug c++/11355] " pinskia at physics dot uc dot edu
  2003-06-28  2:51 ` bangerth at dealii dot org
  0 siblings, 2 replies; 3+ messages in thread
From: mohit_aron at hotmail dot com @ 2003-06-28  0:31 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: compilation involving static class members is affected
                    by the presence of virtual destructor
           Product: gcc
           Version: 2.95.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mohit_aron at hotmail dot com
                CC: gcc-bugs at gcc dot gnu dot org

Consider a class Foo defined in header file foo.h, with a static method in Foo
called Bar. Lets say foo.cc includes the header file foo.h and uses Foo::Bar().
Here are the following cases:

1) Class Foo has no virtual destructor. In this case the following commands:
        g++ -c -fno-inline  foo.cc
        nm -n foo.o | grep Bar
     shows Bar to be defined as a weak symbol.

2) Class Foo has a virtual destructor declared (but not defined) AND the
definition is not present in foo.cc
        g++ -c -fno-inline  foo.cc
        nm -n foo.o | grep Bar
     shows Bar to be defined as an undefined symbol   (this is the bug)

3) Class Foo has a virtual destructor declared AND the definition of the
destructor is present in foo.cc:
        g++ -c -fno-inline  foo.cc
        nm -n foo.o | grep Bar
     shows Bar to be defined as a weak symbol.



The bug is demonstrated by case (2) above.


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

* [Bug c++/11355] compilation involving static class members is affected by the presence of virtual destructor
  2003-06-28  0:31 [Bug c++/11355] New: compilation involving static class members is affected by the presence of virtual destructor mohit_aron at hotmail dot com
@ 2003-06-28  1:30 ` pinskia at physics dot uc dot edu
  2003-06-28  2:51 ` bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-06-28  1:30 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


------- Additional Comments From pinskia at physics dot uc dot edu  2003-06-28 01:30 -------
2.95.3 is no longer being updated, and it is too old to support, can you try a newer gcc, 
3.3?  And in each of your cases I get only undefined symbols, why do you think Bar 
should be weak. Also can you provide the output of `gcc -v'?


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

* [Bug c++/11355] compilation involving static class members is affected by the presence of virtual destructor
  2003-06-28  0:31 [Bug c++/11355] New: compilation involving static class members is affected by the presence of virtual destructor mohit_aron at hotmail dot com
  2003-06-28  1:30 ` [Bug c++/11355] " pinskia at physics dot uc dot edu
@ 2003-06-28  2:51 ` bangerth at dealii dot org
  1 sibling, 0 replies; 3+ messages in thread
From: bangerth at dealii dot org @ 2003-06-28  2:51 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


------- Additional Comments From bangerth at dealii dot org  2003-06-28 02:51 -------
That is the same problem as when vtables are emitted. Actually, it's even
a FAQ and should also be documented somewhere in the manual. I should be
pretty wrong if this is not the case. If it _should_ be the case, please post
a complete testcase (and claim _why_ gcc's behavior is wrong) and we can consider
re-opening the report again.

W.


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

end of thread, other threads:[~2003-06-28  2:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-28  0:31 [Bug c++/11355] New: compilation involving static class members is affected by the presence of virtual destructor mohit_aron at hotmail dot com
2003-06-28  1:30 ` [Bug c++/11355] " pinskia at physics dot uc dot edu
2003-06-28  2:51 ` bangerth at dealii 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).