--analyze passes -w, but -cc1 -analyze doesn't. Oops!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197741
91177308-0d34-0410-b5e6-
96231b3b80d8
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
-// expected-no-diagnostics
bool PR14634(int x) {
double y = (double)x;
}
void intAsBoolAsSwitchCondition(int c) {
- switch ((bool)c) {
+ switch ((bool)c) { // expected-warning {{switch condition has boolean value}}
case 0:
break;
}
+
+ switch ((int)(bool)c) { // no-warning
+ case 0:
+ break;
+ }
}