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