Skip to content

Commit 5a967ae

Browse files
committed
Add assert that ParentFD and Pattern are both null/non-null
1 parent 95ff3d3 commit 5a967ae

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Sema/SemaLambda.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,6 +2390,8 @@ Sema::LambdaScopeForCallOperatorInstantiationRAII::
23902390
dyn_cast<FunctionDecl>(getLambdaAwareParentOfDeclContext(ParentFD));
23912391
Pattern =
23922392
dyn_cast<FunctionDecl>(getLambdaAwareParentOfDeclContext(Pattern));
2393+
assert(((ParentFD && Pattern) || (!ParentFD && !Pattern)) &&
2394+
"Lambda decl should be paired");
23932395

23942396
if (!ParentFD || !Pattern)
23952397
break;

0 commit comments

Comments
 (0)