Skip to content

Commit cafa252

Browse files
authored
Merge pull request #38742 from beccadax/warring-triad
Start testing Swift 6 mode changes
2 parents 8296c58 + aeec3ae commit cafa252

10 files changed

+644
-1
lines changed

lib/Basic/Version.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,17 @@ Optional<Version> Version::getEffectiveLanguageVersion() const {
326326
static_assert(SWIFT_VERSION_MAJOR == 5,
327327
"getCurrentLanguageVersion is no longer correct here");
328328
return Version::getCurrentLanguageVersion();
329+
case 6:
330+
// Allow version '6' in asserts compilers *only* so that we can start
331+
// testing changes slated for Swift 6. Note that it's still not listed in
332+
// `Version::getValidEffectiveVersions()`.
333+
// FIXME: When Swift 6 becomes real, remove 'REQUIRES: asserts' from tests
334+
// using '-swift-version 6'.
335+
#ifdef NDEBUG
336+
LLVM_FALLTHROUGH;
337+
#else
338+
return Version{6};
339+
#endif
329340
default:
330341
return None;
331342
}

lib/Frontend/CompilerInvocation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
657657
}
658658

659659
Opts.EnableConcisePoundFile =
660-
Args.hasArg(OPT_enable_experimental_concise_pound_file);
660+
Args.hasArg(OPT_enable_experimental_concise_pound_file) ||
661+
Opts.EffectiveLanguageVersion.isVersionAtLeast(6);
661662
Opts.EnableFuzzyForwardScanTrailingClosureMatching =
662663
Args.hasFlag(OPT_enable_fuzzy_forward_scan_trailing_closure_matching,
663664
OPT_disable_fuzzy_forward_scan_trailing_closure_matching,

0 commit comments

Comments
 (0)