mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-23 21:45:46 -04:00

Summary: Binary conditional operator gave warnings where ternary operators did not. They have been fixed to warn similarly to ternary operators. Link: https://bugs.llvm.org/show_bug.cgi?id=42239 Reviewers: rsmith, aaron.ballman, nickdesaulniers Reviewed By: rsmith, nickdesaulniers Subscribers: srhines, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63369 llvm-svn: 363857
16 lines
428 B
C
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;
|
|
};
|
|
|