SE-0362: Only warn about features that are enabled by the language mode.

This commit is contained in:
Allan Shortlidge
2024-11-20 11:34:06 -08:00
parent ec8558942c
commit d7b2d921e7
3 changed files with 10 additions and 15 deletions

View File

@@ -795,13 +795,9 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
// diagnose and skip it.
if (auto firstVersion = getFeatureLanguageVersion(*feature)) {
if (Opts.isSwiftVersionAtLeast(*firstVersion)) {
Diags
.diagnose(SourceLoc(), diag::error_upcoming_feature_on_by_default,
getFeatureName(*feature), *firstVersion)
.limitBehaviorIf(!enableUpcoming, DiagnosticBehavior::Warning);
if (enableUpcoming)
HadError = true;
Diags.diagnose(SourceLoc(),
diag::warning_upcoming_feature_on_by_default,
getFeatureName(*feature), *firstVersion);
continue;
}
}