[clang-tools-extra] [clang] [llvm] [Sema] When checking for constraint equivalence, do not calculate satisfaction (PR #74490)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 08:06:42 PST 2023


================
@@ -4077,6 +4084,7 @@ Sema::SubstExpr(Expr *E, const MultiLevelTemplateArgumentList &TemplateArgs) {
   TemplateInstantiator Instantiator(*this, TemplateArgs,
                                     SourceLocation(),
                                     DeclarationName());
+  Instantiator.setEvaluateConstraints(false);
----------------
ilya-biryukov wrote:

I have spent some time to understand this better and I agree that changing the default behavior of `SubstExpr` is quite a bet. So I made a more localized fix instead, please take a look. I believe we don't need to wait for a branch cut to land this change.

I have also changed `SubstConstraintExpr` to simply call `SubstExpr` and updated the comment to avoid confusion (as mentioned before, the comment used to say they're different, but they are actually the same).

I have also added tests to make sure the uses of `requires-expr` in SFINAE contexts decltype does not cause issues, I believe it tests other code paths a bit.


https://github.com/llvm/llvm-project/pull/74490


More information about the cfe-commits mailing list