1 // RUN: %clang_cc1 -x c -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s
2 // RUN: %clang_cc1 -x c++ -fsyntax-only -verify -Wenum-compare -Wno-unused-comparison %s
4 // In C enumerators (i.e enumeration constants) have type int (until C23). In
5 // order to support diagnostics such as -Wenum-compare we pretend they have the
6 // type of their enumeration.
15 // In C++ this comparison doesnt warn as enumerators dont have the type of
16 // their enumeration before the closing brace. We mantain the same behavior
29 // expected-warning@-1 {{comparison of different enumeration types}}
31 // expected-warning@-1 {{comparison of different enumeration types}}
33 // expected-warning@-1 {{comparison of different enumeration types}}
35 // expected-warning@-1 {{comparison of different enumeration types}}
37 // expected-warning@-1 {{comparison of different enumeration types}}
39 // expected-warning@-1 {{comparison of different enumeration types}}
41 // expected-warning@-1 {{comparison of different enumeration types}}
43 // expected-warning@-1 {{comparison of different enumeration types}}
45 // expected-warning@-1 {{comparison of different enumeration types}}
47 // In the following cases we purposefully differ from GCC and dont warn