[Diagnostics] Add InFlightDiagnostic::warnUntilSwiftVersion to limit the

diagnostic behavior to a warning until the specified language version.

This helper can be used to stage in fixes for stricter diagnostics
as warnings until the next major language version.
This commit is contained in:
Holly Borla
2021-07-07 12:50:14 -07:00
parent 7a35c478b6
commit a06c4afcfa
3 changed files with 23 additions and 0 deletions

View File

@@ -451,6 +451,8 @@ void CompilerInstance::setUpDiagnosticOptions() {
}
Diagnostics.setDiagnosticDocumentationPath(
Invocation.getDiagnosticOptions().DiagnosticDocumentationPath);
Diagnostics.setLanguageVersion(
Invocation.getLangOptions().EffectiveLanguageVersion);
if (!Invocation.getDiagnosticOptions().LocalizationCode.empty()) {
Diagnostics.setLocalization(
Invocation.getDiagnosticOptions().LocalizationCode,