| // RUN: %clang_cc1 -fcxx-exceptions -fexceptions -fsyntax-only -Wunreachable-code-aggressive -fblocks -verify %s |
| ++i) { // expected-warning {{loop will run at most once (loop increment never executed)}} |
| if (j == 23) // missing {}'s |
| return 1; // expected-warning {{will never be executed}} |
| ++i) { // expected-warning {{loop will run at most once (loop increment never executed)}} |
| if (j == 23) // missing {}'s |
| return bar(); // expected-warning {{will never be executed}} |
| bar(); // expected-warning {{will never be executed}} |
| bar(); // expected-warning {{will never be executed}} |
| bar(); // expected-warning {{will never be executed}} |
| bar(); // expected-warning {{will never be executed}} |
| bar(); // expected-warning {{will never be executed}} |
| // PR 6130 - Don't warn about bogus unreachable code with throw's and |
| throw PR6130(); // no-warning |
| extern "C" void foo(void); |
| extern "C" __attribute__((weak)) decltype(foo) foo; |
| if (a > 4) [[ likely ]] { // no-warning |
| if (a > 4) [[ unlikely ]] { // no-warning |
| return; // expected-warning {{will never be executed}} |
| [[clang::musttail]] return g(a); // no-warning |
| [[clang::musttail]] return g(a); // expected-warning {{will never be executed}} |