|
@@ -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();
|
|
|
}
|
|
|
|