[PATCH] D133052: [clang] Avoid crash when expanding conversion templates in concepts.

Utkarsh Saxena via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 28 06:15:52 PDT 2022


usaxena95 added a comment.

My suggestion would be to properly handle cycles in `CheckConstraintSatisfaction`. This problem goes beyond cycles introduced by conversion. See #53213 <https://github.com/llvm/llvm-project/issues/53213> and #44304 <https://github.com/llvm/llvm-project/issues/44304> https://godbolt.org/z/v41ez6eW4. These two bugs are due to an assertion failure while inserting entry into SatisfactionCache.

My suggestion would be detect cycles in `CheckConstraintSatisfaction`. We already have a way to check "whether we have seen this before ?" in `SatisfactionCache` using `FoldingSet` for `ConstraintSatisfaction`. We could use a similar set to track the constraints being evaluated. Stop evaluation when we detect a cycle. Attach appropriate details to the Satisfaction and fail the constraint.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133052



More information about the cfe-commits mailing list