Skip to content

Commit 65bcdea

Browse files
committed
Replace an unnecessary null check with an assert; NFC
1 parent 2456e11 commit 65bcdea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/AST/DeclBase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,10 @@ bool DeclContext::Encloses(const DeclContext *DC) const {
12191219

12201220
DeclContext *DeclContext::getNonTransparentContext() {
12211221
DeclContext *DC = this;
1222-
while (DC && DC->isTransparentContext())
1222+
while (DC->isTransparentContext()) {
12231223
DC = DC->getParent();
1224+
assert(DC && "All transparent contexts should have a parent!");
1225+
}
12241226
return DC;
12251227
}
12261228

0 commit comments

Comments
 (0)