trifurcate the MoveOnly feature

I want to reserve Feature::MoveOnly only for move-only types and other
things that are part of SE-390. Other prototyped features like
noimplicitcopy and some older names for consume were left behind
as guarded by this Feature. That's really not the right way to do it,
as people will expect that the feature is enabled all the time, which
would put those unofficial features into on-by-default. So this change
introduces two new Features to guard those unofficial features.
This commit is contained in:
Kavon Farvardin
2023-03-24 15:43:35 -07:00
parent df35da45cc
commit 6f98e9a2c6
6 changed files with 23 additions and 4 deletions

View File

@@ -721,8 +721,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.Features.insert(Feature::NamedOpaqueTypes);
if (Args.hasArg(OPT_enable_experimental_flow_sensitive_concurrent_captures))
Opts.Features.insert(Feature::FlowSensitiveConcurrencyCaptures);
if (Args.hasArg(OPT_enable_experimental_move_only))
if (Args.hasArg(OPT_enable_experimental_move_only)) {
// FIXME: drop addition of Feature::MoveOnly once its queries are gone.
Opts.Features.insert(Feature::MoveOnly);
Opts.Features.insert(Feature::NoImplicitCopy);
Opts.Features.insert(Feature::OldOwnershipOperatorSpellings);
}
if (Args.hasArg(OPT_experimental_one_way_closure_params))
Opts.Features.insert(Feature::OneWayClosureParameters);
if (Args.hasArg(OPT_enable_experimental_associated_type_inference))