diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -222,6 +222,10 @@ 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`_. New Pragmas in Clang -------------------- diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -277,7 +277,6 @@ 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") diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -5656,10 +5656,6 @@ "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>; defm recovery_ast : BoolOption<"f", "recovery-ast", LangOpts<"RecoveryAST">, DefaultTrue, diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -317,10 +317,8 @@ 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); } diff --git a/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp b/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp --- a/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp +++ b/clang/test/SemaTemplate/cxx2a-constraint-caching.cpp @@ -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 @@ -25,10 +24,5 @@ // because the constraint satisfaction results are cached. constexpr void f(A a, int = 2) {} } -#ifdef NO_CACHE -static_assert(!C); -static_assert(!foo()); -#else static_assert(C); static_assert(foo()); -#endif