[swift-version] Allow swift-version 4 and tests

The recent @escaping on variadic argument closures back-compat fix is
the first Swift 3.0 compatibility behavior that we don't want to carry
forwards indefinitely into the future. To address this, we
version-gate the diagnostic suppression.

Makes it an official compatibility check. Creates new test directory
for compatibility testing. Allow -swift-version 4 so that we can test
it both ways.
This commit is contained in:
Michael Ilseman
2016-10-11 17:39:11 -07:00
parent 54f4103b5b
commit 12fb0bad7b
7 changed files with 30 additions and 9 deletions

View File

@@ -227,6 +227,11 @@ namespace swift {
return CustomConditionalCompilationFlags;
}
/// Whether our effective Swift version is in the Swift 3 family
bool isSwiftVersion3() const {
return EffectiveLanguageVersion.isVersion3();
}
/// Returns true if the 'os' platform condition argument represents
/// a supported target operating system.
///

View File

@@ -95,6 +95,9 @@ public:
/// are attempting to maintain backward-compatibility support for.
bool isValidEffectiveLanguageVersion() const;
/// Whether this version is in the Swift 3 family
bool isVersion3() const { return !empty() && Components[0] == 3; }
/// Parse a version in the form used by the _compiler_version \#if condition.
static Version parseCompilerVersionString(StringRef VersionString,
SourceLoc Loc,