This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 16 Apr 2016 00:50:52 +0000
- Subject: [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
- Auto-submitted: auto-generated
- References: <bug-70616-4 at http dot gcc dot gnu dot org/bugzilla/>
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.