diff options
Diffstat (limited to 'test/Sema/warn-unused-value.c')
-rw-r--r-- | test/Sema/warn-unused-value.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/warn-unused-value.c b/test/Sema/warn-unused-value.c index 876eb9e..95cd8fb 100644 --- a/test/Sema/warn-unused-value.c +++ b/test/Sema/warn-unused-value.c @@ -72,6 +72,15 @@ int test_logical_bar() { return x; } +// PR8282 +void conditional_for_control_flow(int cond, int x, int y) +{ + cond? y++ : x; // no-warning + cond? y : ++x; // no-warning + cond? (x |= y) : ++x; // no-warning + cond? y : x; // expected-warning {{expression result unused}} +} + struct s0 { int f0; }; void f0(int a); |