clang: Add test for -Wunreachable-code + weak redeclaration

This tests what caused the revert in 7b033238.
This commit is contained in:
Nico Weber 2020-09-04 10:26:46 -04:00
parent 7d53fecb67
commit 2a03f270d6
1 changed files with 9 additions and 0 deletions

View File

@ -68,3 +68,12 @@ int pr6130(unsigned i) {
throw PR6130(); // no-warning
}
}
extern "C" void foo(void);
extern "C" __attribute__((weak)) decltype(foo) foo;
void weak_redecl() {
if (foo)
return;
bar(); // no-warning
}