Skip to content

Commit c4ada13

Browse files
[NFC][Clang] Fix static analyzer concern about null value dereference
Differential Revision: https://reviews.llvm.org/D157554
1 parent a8376bb commit c4ada13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/Sema/SemaExprCXX.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9072,8 +9072,10 @@ Sema::BuildExprRequirement(
90729072
MultiLevelTemplateArgumentList MLTAL(Param, TAL.asArray(),
90739073
/*Final=*/false);
90749074
MLTAL.addOuterRetainedLevels(TPL->getDepth());
9075-
Expr *IDC = Param->getTypeConstraint()->getImmediatelyDeclaredConstraint();
9076-
ExprResult Constraint = SubstExpr(IDC, MLTAL);
9075+
const TypeConstraint *TC = Param->getTypeConstraint();
9076+
assert(TC && "Type Constraint cannot be null here");
9077+
ExprResult Constraint =
9078+
SubstExpr(TC->getImmediatelyDeclaredConstraint(), MLTAL);
90779079
if (Constraint.isInvalid()) {
90789080
Status = concepts::ExprRequirement::SS_ExprSubstitutionFailure;
90799081
} else {

0 commit comments

Comments
 (0)