[Driver] Remove -fno-concept-satisfaction-caching

The flag was added when the C++20 draft did not allow for concept
caching. The final C++20 standard permits the caching, so flag is
redundant. See http://wg21.link/p2104r0.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D125014
This commit is contained in:
Ilya Biryukov 2022-05-05 15:52:04 +00:00
parent 87a55137e2
commit e13c28ec59
5 changed files with 6 additions and 15 deletions

View File

@ -222,6 +222,10 @@ Modified Compiler Flags
Removed Compiler Flags
-------------------------
- Removed the ``-fno-concept-satisfaction-caching`` flag. The flag was added
at the time when the draft of C++20 standard did not permit caching of
atomic constraints. The final standard permits such caching, see
`WG21 P2104R0<http://wg21.link/p2104r0>`_.
New Pragmas in Clang
--------------------

View File

@ -277,7 +277,6 @@ LANGOPT(SizedDeallocation , 1, 0, "sized deallocation")
LANGOPT(AlignedAllocation , 1, 0, "aligned allocation")
LANGOPT(AlignedAllocationUnavailable, 1, 0, "aligned allocation functions are unavailable")
LANGOPT(NewAlignOverride , 32, 0, "maximum alignment guaranteed by '::operator new(size_t)'")
LANGOPT(ConceptSatisfactionCaching , 1, 1, "enable satisfaction caching for C++20 Concepts")
BENIGN_LANGOPT(ModulesCodegen , 1, 0, "Modules code generation")
BENIGN_LANGOPT(ModulesDebugInfo , 1, 0, "Modules debug info")
BENIGN_LANGOPT(ElideConstructors , 1, 1, "C++ copy constructor elision")

View File

@ -5656,10 +5656,6 @@ def ftest_module_file_extension_EQ :
"The argument is parsed as blockname:major:minor:hashed:user info">;
def fconcepts_ts : Flag<["-"], "fconcepts-ts">,
HelpText<"Enable C++ Extensions for Concepts. (deprecated - use -std=c++2a)">;
def fno_concept_satisfaction_caching : Flag<["-"],
"fno-concept-satisfaction-caching">,
HelpText<"Disable satisfaction caching for C++2a Concepts.">,
MarshallingInfoNegativeFlag<LangOpts<"ConceptSatisfactionCaching">>;
defm recovery_ast : BoolOption<"f", "recovery-ast",
LangOpts<"RecoveryAST">, DefaultTrue,

View File

@ -317,10 +317,8 @@ bool Sema::CheckConstraintSatisfaction(
OutSatisfaction.IsSatisfied = true;
return false;
}
bool ShouldCache = LangOpts.ConceptSatisfactionCaching && Template;
if (!ShouldCache) {
return ::CheckConstraintSatisfaction(*this, Template, ConstraintExprs,
if (!Template) {
return ::CheckConstraintSatisfaction(*this, nullptr, ConstraintExprs,
TemplateArgs, TemplateIDRange,
OutSatisfaction);
}

View File

@ -1,5 +1,4 @@
// RUN: %clang_cc1 -std=c++2a -verify %s
// RUN: %clang_cc1 -std=c++2a -verify %s -fno-concept-satisfaction-caching -DNO_CACHE
// expected-no-diagnostics
template<typename T>
@ -25,10 +24,5 @@ namespace a {
// because the constraint satisfaction results are cached.
constexpr void f(A a, int = 2) {}
}
#ifdef NO_CACHE
static_assert(!C<a::A>);
static_assert(!foo<a::A>());
#else
static_assert(C<a::A>);
static_assert(foo<a::A>());
#endif