diff options
Diffstat (limited to 'clang/test/Analysis/casts.cpp')
-rw-r--r-- | clang/test/Analysis/casts.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/test/Analysis/casts.cpp b/clang/test/Analysis/casts.cpp index 763f942ede6..53e1cd085ac 100644 --- a/clang/test/Analysis/casts.cpp +++ b/clang/test/Analysis/casts.cpp @@ -1,5 +1,4 @@ // RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s -// expected-no-diagnostics bool PR14634(int x) { double y = (double)x; @@ -12,8 +11,13 @@ bool PR14634_implicit(int 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; + } } |