From 599027857e1007ff402094a3a550b4832f3f5146 Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Thu, 28 Mar 2024 18:58:52 +0100 Subject: [PATCH] [clang] Add invalid check in NormalizedConstraint::fromConstraintExpr. (#86943) This is an oversight spot in #86869, we should always check the invalid bit after constructing the `Sema::InstantiatingTemplate` RAII object. --- clang/lib/Sema/SemaConcept.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp index a2d8ba9a96d7a4..b2986c5012ea2b 100644 --- a/clang/lib/Sema/SemaConcept.cpp +++ b/clang/lib/Sema/SemaConcept.cpp @@ -1356,6 +1356,8 @@ NormalizedConstraint::fromConstraintExpr(Sema &S, NamedDecl *D, const Expr *E) { S, CSE->getExprLoc(), Sema::InstantiatingTemplate::ConstraintNormalization{}, D, CSE->getSourceRange()); + if (Inst.isInvalid()) + return std::nullopt; // C++ [temp.constr.normal]p1.1 // [...] // The normal form of an id-expression of the form C,