diff options
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 9c73ee7ede3..30599ea7cfb 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -1497,9 +1497,10 @@ void NamedDecl::printQualifiedName(raw_ostream &OS, using ContextsTy = SmallVector<const DeclContext *, 8>; ContextsTy Contexts; - // Collect contexts. - while (Ctx && isa<NamedDecl>(Ctx)) { - Contexts.push_back(Ctx); + // Collect named contexts. + while (Ctx) { + if (isa<NamedDecl>(Ctx)) + Contexts.push_back(Ctx); Ctx = Ctx->getParent(); } |

