Merge pull request #61844 from xedin/rdar-99884335

[Basic] Make it possible to access some experimental features in production compilers
This commit is contained in:
Pavel Yaskevich
2022-11-01 14:28:39 -07:00
committed by GitHub
4 changed files with 45 additions and 27 deletions

View File

@@ -635,9 +635,11 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
// (non-release) builds for testing purposes.
if (auto feature = getExperimentalFeature(A->getValue())) {
#ifdef NDEBUG
Diags.diagnose(SourceLoc(),
diag::error_experimental_feature_not_available,
A->getValue());
if (!isFeatureAvailableInProduction(*feature)) {
Diags.diagnose(SourceLoc(),
diag::error_experimental_feature_not_available,
A->getValue());
}
#endif
Opts.Features.insert(*feature);