Files
swift-mirror/test/ClangImporter/Inputs/enum-inferred-exhaustivity.h
Daniel Rodríguez Troitiño 66b656906c [windows] Avoid warning in header in test turning into fatal error.
In Windows, ClangImporter seems to execute with Microsoft compatibility,
and there are some more warnings that do not happen in Unix. One of them
seems to be -Wmicrosoft-enum-forward-reference which warns about forward
defined enums, like the one that happens in this header. Since the
-warnings-as-errors flag is now passed down to ClangImporter, this
warning will make this test fail.

Simply use the #pragma to disable the warning for this piece of code.
2019-11-08 18:00:44 -08:00

20 lines
646 B
C

#if defined(CF_ENUM)
# error "This test requires controlling the definition of CF_ENUM"
#endif
// Make this C-compatible by leaving out the type.
#define CF_ENUM(_name) enum _name _name; enum _name
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wmicrosoft-enum-forward-reference"
typedef CF_ENUM(EnumWithDefaultExhaustivity) {
EnumWithDefaultExhaustivityLoneCase
};
// This name is also specially recognized by Swift.
#define __CF_ENUM_ATTRIBUTES __attribute__((enum_extensibility(open)))
typedef CF_ENUM(EnumWithSpecialAttributes) {
EnumWithSpecialAttributesLoneCase
} __CF_ENUM_ATTRIBUTES;
#pragma clang diagnostic pop