mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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.
|
||||
///
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user