return-noreturn.cpp [plain text]
void pr6884_abort() __attribute__((noreturn));
struct pr6884_abort_struct {
pr6884_abort_struct() {}
~pr6884_abort_struct() __attribute__((noreturn)) { pr6884_abort(); }
};
struct other { ~other() {} };
namespace abort_struct_complex_cfgs {
int basic(int x) {
switch (x) { default: pr6884_abort(); }
}
int f1(int x) {
switch (x) default: pr6884_abort_struct();
}
int f2(int x) {
switch (x) { default: pr6884_abort_struct(); }
}
int f2_positive(int x) {
switch (x) { default: ; }
} int f3(int x) {
switch (x) { default: { pr6884_abort_struct(); } }
}
int f4(int x) {
switch (x) default: L1: L2: case 4: pr6884_abort_struct();
}
int f5(int x) {
switch (x) default: L1: { L2: case 4: pr6884_abort_struct(); }
}
int f6(int x) {
switch (x) default: L1: L2: case 4: { pr6884_abort_struct(); }
}
int g1(int x) {
other o;
switch (x) default: pr6884_abort_struct();
}
int g2(int x) {
other o;
switch (x) { default: pr6884_abort_struct(); }
}
int g2_positive(int x) {
other o;
switch (x) { default: ; }
} int g3(int x) {
other o;
switch (x) { default: { pr6884_abort_struct(); } }
}
int g4(int x) {
other o;
switch (x) default: L1: L2: case 4: pr6884_abort_struct();
}
int g5(int x) {
other o;
switch (x) default: L1: { L2: case 4: pr6884_abort_struct(); }
}
int g6(int x) {
other o;
switch (x) default: L1: L2: case 4: { pr6884_abort_struct(); }
}
int h1(int x) {
other o;
switch (x) default: pr6884_abort_struct a;
}
int h2(int x) {
other o;
switch (x) { default: pr6884_abort_struct a; }
}
int h3(int x) {
other o;
switch (x) { default: { pr6884_abort_struct a; } }
}
int h4(int x) {
other o;
switch (x) default: L1: L2: case 4: pr6884_abort_struct a;
}
int h5(int x) {
other o;
switch (x) default: L1: { L2: case 4: pr6884_abort_struct a; }
}
int h6(int x) {
other o;
switch (x) default: L1: L2: case 4: { pr6884_abort_struct a; }
}
}
struct PR9380 {
~PR9380();
};
struct PR9380_B : public PR9380 {
PR9380_B( const PR9380& str );
};
void test_PR9380(const PR9380& aKey) {
const PR9380& flatKey = PR9380_B(aKey);
}
void test_array() {
PR9380 a[2];
}
void test_typedefs() {
typedef PR9380 PR9380_Ty;
PR9380_Ty test;
PR9380_Ty test2[20];
}
enum PR9412_MatchType { PR9412_Exact };
template <PR9412_MatchType type> int PR9412_t() {
switch (type) {
case PR9412_Exact:
default:
break;
}
}
void PR9412_f() {
PR9412_t<PR9412_Exact>(); }