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.

Reply via email to