diff options
Diffstat (limited to 'test/SemaCXX/warn-unreachable.cpp')
-rw-r--r-- | test/SemaCXX/warn-unreachable.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/SemaCXX/warn-unreachable.cpp b/test/SemaCXX/warn-unreachable.cpp index a14e422686..c664c19128 100644 --- a/test/SemaCXX/warn-unreachable.cpp +++ b/test/SemaCXX/warn-unreachable.cpp @@ -393,6 +393,9 @@ void tautological_compare(bool x, int y) { else calledFun(); // expected-warning {{will never be executed}} + if (y == -1 && y != -1) // expected-note {{silence}} + calledFun(); // expected-warning {{will never be executed}} + // TODO: Extend warning to the following code: if (x < -1) calledFun(); @@ -408,6 +411,4 @@ void tautological_compare(bool x, int y) { else calledFun(); - if (y == -1 && y != -1) - calledFun(); } |