[clang] [Clang] fix generic lambda inside requires-clause of friend function template (PR #99813)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 21 19:04:46 PDT 2024


================
@@ -1691,10 +1691,7 @@ class ConstraintRefersToContainingTemplateChecker
   using inherited::TransformTemplateTypeParmType;
   QualType TransformTemplateTypeParmType(TypeLocBuilder &TLB,
                                          TemplateTypeParmTypeLoc TL, bool) {
-    assert(TL.getDecl()->getDepth() <= TemplateDepth &&
-           "Nothing should reference a value below the actual template depth, "
-           "depth is likely wrong");
-    if (TL.getDecl()->getDepth() != TemplateDepth)
+    if (TL.getDecl()->getDepth() < TemplateDepth)
----------------
zyn0217 wrote:

I don't see the justification for removing the assert here. When would we otherwise hit it?

Besides, we have the same pattern in `TransformTemplateTypeParmType()` above. Does it also impact anything?

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


More information about the cfe-commits mailing list