diff options
Diffstat (limited to 'test/Sema/warn-tautological-compare.c')
-rw-r--r-- | test/Sema/warn-tautological-compare.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/warn-tautological-compare.c b/test/Sema/warn-tautological-compare.c index 55de617..e4eec11 100644 --- a/test/Sema/warn-tautological-compare.c +++ b/test/Sema/warn-tautological-compare.c @@ -84,3 +84,12 @@ void _HTTPClientErrorHandler(int me) int *result; SAVE_READ(&me); } + +void test_conditional_operator() { + int x; + x = b ? 1 : 0; // expected-warning {{address of array}} + x = c.x ? 1 : 0; // expected-warning {{address of array}} + x = str ? 1 : 0; // expected-warning {{address of array}} + x = array ? 1 : 0; // expected-warning {{address of array}} + x = &x ? 1 : 0; // expected-warning {{address of 'x'}} +} |