Frontend: Warn if adoption mode is requested but not supported

This commit is contained in:
Anthony Latsis
2025-02-20 23:24:37 +00:00
parent 8dab67bcee
commit 756abb9284
3 changed files with 20 additions and 0 deletions

View File

@@ -831,6 +831,13 @@ static bool ParseEnabledFeatureArgs(LangOptions &Opts, ArgList &Args,
/*didYouMean=*/validModeName);
continue;
}
if (!isFeatureAdoptable(*feature)) {
Diags.diagnose(SourceLoc(),
diag::feature_does_not_support_adoption_mode,
featureName);
continue;
}
} else {
// `-disable-*-feature` flags do not support a mode specifier.
Diags.diagnose(SourceLoc(), diag::cannot_disable_feature_with_mode,