Skip to content

Start testing Swift 6 mode changes #38742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/Basic/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,17 @@ Optional<Version> Version::getEffectiveLanguageVersion() const {
static_assert(SWIFT_VERSION_MAJOR == 5,
"getCurrentLanguageVersion is no longer correct here");
return Version::getCurrentLanguageVersion();
case 6:
// Allow version '6' in asserts compilers *only* so that we can start
// testing changes slated for Swift 6. Note that it's still not listed in
// `Version::getValidEffectiveVersions()`.
// FIXME: When Swift 6 becomes real, remove 'REQUIRES: asserts' from tests
// using '-swift-version 6'.
#ifdef NDEBUG
LLVM_FALLTHROUGH;
#else
return Version{6};
#endif
default:
return None;
}
Expand Down
3 changes: 2 additions & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
}

Opts.EnableConcisePoundFile =
Args.hasArg(OPT_enable_experimental_concise_pound_file);
Args.hasArg(OPT_enable_experimental_concise_pound_file) ||
Opts.EffectiveLanguageVersion.isVersionAtLeast(6);
Opts.EnableFuzzyForwardScanTrailingClosureMatching =
Args.hasFlag(OPT_enable_fuzzy_forward_scan_trailing_closure_matching,
OPT_disable_fuzzy_forward_scan_trailing_closure_matching,
Expand Down
Loading