blob: 346cab476495799623fdba3ddcefb2c3f766c98d [file] [log] [blame]
// PR c++/54046
// { dg-do compile }
// { dg-options "-O0 -Wall" }
void foo (void) __attribute__((noreturn));
struct A
{
~A () {}
};
bool
check1 (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
throw "X";
break;
}
}
bool
check2 (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
foo ();
break;
}
}
bool
check3 (int x)
{
switch (x)
{
case 0:
return false;
default:
throw "X";
break;
}
}
bool
check4 (int x)
{
switch (x)
{
case 0:
return false;
default:
foo ();
break;
}
}
bool
check5 (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
throw "X";
}
}
bool
check6 (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
foo ();
}
}