[clang] [Clang] Avoid crash when expression requirements are substitution failures (PR #176896)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 20 09:20:37 PST 2026
================
@@ -101,8 +101,13 @@ concepts::ExprRequirement::ReturnTypeRequirement::getTypeConstraint() const {
// Search through the requirements, and see if any have a RecoveryExpr in it,
// which means this RequiresExpr ALSO needs to be invalid.
static bool RequirementContainsError(concepts::Requirement *R) {
- if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R))
- return ExprReq->getExpr() && ExprReq->getExpr()->containsErrors();
+ if (auto *ExprReq = dyn_cast<concepts::ExprRequirement>(R)) {
+ if (ExprReq->isExprSubstitutionFailure())
+ return true;
+ if (auto *E = ExprReq->getExpr())
+ return E->containsErrors();
+ return false;
----------------
shafik wrote:
So as I read your description this does not seem to be covered by the existing bug.
Is this `return false` covered in testing as all? It feels like a second change but the test seems to cover only the first return statement. Please clarify.
https://github.com/llvm/llvm-project/pull/176896
More information about the cfe-commits
mailing list