From 0cee5b227e5e985192f2d88e33fadbf249a5bc51 Mon Sep 17 00:00:00 2001 From: Nate Chandler Date: Mon, 13 Dec 2021 14:55:01 -0800 Subject: [PATCH] Fixed flag checking for lexical borrow scopes. Previously the following pairs were prohibited incorrectly: - -enable-lexical-borrow-scopes=true, -enable-experimental-move-only - -enable-lexical-lifetimes=true, -enable-experimental-move-only and the following pairs were allowed incorrectly: - -enable-lexical-borrow-scopes=false, -enable-experimental-move-only - -enable-lexical-lifetimes=false, -enable-experimental-move-only Here, that's fixed. The first two pairs are allowed and the second two pairs prohibited. --- lib/Frontend/CompilerInvocation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 054ad0f97d8c3..b0196498eb998 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -1495,7 +1495,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args, } if (Args.hasArg(OPT_enable_experimental_move_only) && - (enableLexicalBorrowScopesFlag.getValueOr(false))) { + !enableLexicalBorrowScopesFlag.getValueOr(true)) { // Error if move-only is enabled and lexical borrow scopes--on which it // depends--has been disabled. Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination, @@ -1505,7 +1505,7 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args, } if (Args.hasArg(OPT_enable_experimental_move_only) && - (enableLexicalLifetimesFlag.getValueOr(false))) { + !enableLexicalLifetimesFlag.getValueOr(true)) { // Error if move-only is enabled and lexical lifetimes--on which it // depends--has been disabled. Diags.diagnose(SourceLoc(), diag::error_invalid_arg_combination,