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]

[Bug c++/70616] [4.9/5/6/7 Regression] ICE on valid code on x86_64-linux-gnu in build_base_path, at cp/class.c:303


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70616

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
The following test case where test is not a function template does not ICE but
it aborts at runtime because a == 2 at the end of execution:


static int a;

struct A
{
  virtual ~A () { a++; }
};

struct B : public A
{
  virtual ~B () { a++; }
};

void test ()
{
  B *b = new B;
  b->~A ();
} 

int main ()
{
  test  ();
  if (a != 1)
    __builtin_abort ();
}


Changing b->~A () to b->A::~A () makes the program not abort.

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