aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 53dd2ae..e042ae8 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -1219,8 +1219,10 @@ bool DeclContext::Encloses(const DeclContext *DC) const {
DeclContext *DeclContext::getNonTransparentContext() {
DeclContext *DC = this;
- while (DC && DC->isTransparentContext())
+ while (DC->isTransparentContext()) {
DC = DC->getParent();
+ assert(DC && "All transparent contexts should have a parent!");
+ }
return DC;
}