[PATCH] D127487: [Sema] Fix assertion failure when instantiating requires expression

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 22 06:27:23 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:2039
     TransConstraint = TransformExpr(Req->getConstraintExpr());
+    if (!TransConstraint.isInvalid()) {
+      bool CheckSucceeded =
----------------
I think I'd rather collapse this into SOMETHING like:

``` assert((TransConstraint.isInvalid() || (SemaRef.CheckConstraintExpr(TransConstraint.get() || Trap.hasErrorOccurred()) && "...");```

I think thats right?  


================
Comment at: clang/lib/Sema/SemaTemplateInstantiate.cpp:2048
+    // Use version of CheckConstraintSatisfaction that does no substitutions.
+    if (!TransConstraint.isInvalid() &&
+        !TransConstraint.get()->isInstantiationDependent() &&
----------------
Same sorta thing here, if our check is only used for an assert, we should call it in the assert.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127487/new/

https://reviews.llvm.org/D127487



More information about the cfe-commits mailing list