version of GCC: 4.0.0

system type: RedHat 8.0

options given when GCC was configured/built:
 Using built-in specs.
 Target: i686-pc-linux-gnu
 Configured with: ../configure --prefix=/data/gcc/gcc-4.0.0 --exec-
prefix=/data/gcc/gcc-4.0.0
 Thread model: posix
 gcc version 4.0.0

complete command line that triggers the bug:
 g++ Main.cpp -o test
 chmod u+x ./test
 ./test

compiler output (error messages, warnings, etc.): no warnings and messages

Microsoft Visual C++ 7.2 works well with such a source code.

The code of Main.cpp file as below:

#include <stdio.h>

class BaseVector
  {
public:
  BaseVector() {}

  virtual ~BaseVector()  {}
  };

class Vector : public BaseVector
  {
public:
  Vector() : BaseVector()
    {}

  virtual ~Vector() {}

private:
  float theValue[3];
  };

int main(
    int aNoArgs,
    const char* aArgs[])
  {
  BaseVector* v = new Vector[10];
  delete [] v; // <----- Here it is crashed

  return 0;
  }

-- 
           Summary: delete [] called on base virtual destructor class
                    [Segmentation failed]
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sylwekbala at poczta dot onet dot pl
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to