API checker: only diagnose adding enum cases to exhaustive enums

Adding new cases to a non-exhaustive enum type isn't source-breaking
since it only triggers a warning.

rdar://63464929
This commit is contained in:
Xi Ge
2020-05-23 15:43:07 -07:00
parent bcdebc6426
commit c5730beb42
9 changed files with 26 additions and 3 deletions

View File

@@ -524,6 +524,7 @@ class SDKNodeDeclType: public SDKNodeDecl {
// Check whether the type declaration is pulled from an external module so we
// can incorporate extensions in the interested module.
bool IsExternal;
bool IsEnumExhaustive;
bool HasMissingDesignatedInitializers;
bool InheritsConvenienceInitializers;
public:
@@ -550,6 +551,11 @@ public:
return EnumRawTypeName;
}
bool isEnumExhaustive() const {
assert(isEnum());
return IsEnumExhaustive;
}
bool hasMissingDesignatedInitializers() const {
return HasMissingDesignatedInitializers;
};