llvm-project/clang/test/Sema/warn-binary-conditional-exp...

16 lines
428 B
C

// 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;
};