This is the mail archive of the gcc-bugs@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]

c++/8724: G++ 3.2 accepts explicit destructor call for incomplete class


>Number:         8724
>Category:       c++
>Synopsis:       G++ 3.2 accepts explicit destructor call for incomplete class
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          accepts-illegal
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 26 12:06:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Steven Eker
>Release:        3.2
>Organization:
>Environment:
Red Hat Linux 7.3 2.96-110 on a P4
>Description:
G++ 3.2 accepts explicit destructor call for incomplete class and
silently generates bad code. G++ 2.95.3 does not have this problem.
The output is from a linux box. I have also seen this happen with
G++ 3.1 & 3.2 on a solaris box.

> g++-3.2 -v -Wall -S gccBug.cc
Reading specs from /csl/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
Configured with: ./configure --prefix=/csl --program-suffix=-3.2
Thread model: posix
gcc version 3.2
 /csl/lib/gcc-lib/i686-pc-linux-gnu/3.2/cc1plus -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=0 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D_GNU_SOURCE -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ gccBug.cc -D__GNUG__=3 -D__DEPRECATED -D__EXCEPTIONS -quiet -dumpbase gccBug.cc -Wall -version -o gccBug.s
GNU CPP version 3.2 (cpplib) (i386 Linux/ELF)
GNU C++ version 3.2 (i686-pc-linux-gnu)
        compiled by GNU C version 3.2.
#include "..." search starts here:
#include <...> search starts here:
 /csl/include/c++/3.2
 /csl/include/c++/3.2/i686-pc-linux-gnu
 /csl/include/c++/3.2/backward
 /usr/local/include
 /csl/include
 /csl/lib/gcc-lib/i686-pc-linux-gnu/3.2/include
 /csl/i686-pc-linux-gnu/include
 /usr/include
End of search list.
>How-To-Repeat:
class Foo;

void
bar(void* p)
{
  static_cast<Foo*>(p)->~Foo();
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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