llvm-for-llvmta/tools/clang/test/Sema/warn-binary-conditional-exp...

16 lines
428 B
C
Raw Normal View History

2022-04-25 13:02:35 +02:00
// RUN: %clang_cc1 -fsyntax-only -Wunused-value -verify %s
int main() {
int a;
int b;
a ? : b; //expected-warning{{expression result unused}}
a ? a : b; //expected-warning{{expression result unused}}
a ? : ++b;
a ? a : ++b;
++a ? : b; //expected-warning{{expression result unused}}
++a ? a : b; //expected-warning{{expression result unused}}
++a ? : ++b;
++a ? a : ++b;
return 0;
};