diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-24 09:15:30 +0000 |
| commit | 9f4dbff6669c8037f3b036bcf580d14f1a4f12a5 (patch) | |
| tree | 47df2c12b57214af6c31e47404b005675b8b7ffc /test/Analysis/casts.cpp | |
| parent | f73d5f23a889b93d89ddef61ac0995df40286bb8 (diff) | |
Notes
Diffstat (limited to 'test/Analysis/casts.cpp')
| -rw-r--r-- | test/Analysis/casts.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/Analysis/casts.cpp b/test/Analysis/casts.cpp index 339539189ed7b..53e1cd085acd6 100644 --- a/test/Analysis/casts.cpp +++ b/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; @@ -10,3 +9,15 @@ bool PR14634_implicit(int x) { double y = (double)x; return y; } + +void intAsBoolAsSwitchCondition(int c) { + switch ((bool)c) { // expected-warning {{switch condition has boolean value}} + case 0: + break; + } + + switch ((int)(bool)c) { // no-warning + case 0: + break; + } +} |
