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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 5 08:26:52 PST 2023


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

I believe this ends up being incorrect?  We end up calling SubstExpr pretty frequently 'inside' of other constraint expression checking I think, and I think we set whether to evaluate constraints with further checks based on the current instantiator.

So I think this ends up failing to check constraints in a cascading way.  I DO know I tried something similar ot this patch at one point when doing the deferred diagnostics and ran into trouble.

IF we are going to do something like this (as I don't have sufficient evidence here to block I think), we need to hold this off until after the release so it has time to bake.


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


More information about the cfe-commits mailing list