| // RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare-conditional %s |
| // RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare-conditional %s |
| enum ExtendedStatusCodes { |
| STATUS_SOMETHING_INTERESTING = MAX_BASE_STATUS_CODE + 1000, |
| // expected-warning@-2 {{conditional expression between different enumeration types ('ro' and 'rw')}} |
| // expected-no-diagnostics |
| // In the following cases we purposefully differ from GCC and dont warn because |
| // this code pattern is quite sensitive and we dont want to produce so many false positives. |
| int get_flag_anon_enum(int cond) { |
| return c ? STATUS_SOMETHING_INTERESTING : STATUS_SUCCESS; |