diff options
author | Sam McCall <sam.mccall@gmail.com> | 2018-02-02 13:34:47 +0000 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2018-02-02 13:34:47 +0000 |
commit | 34f9d3fe2ac63a50a237809236880dd34953ecd6 (patch) | |
tree | 3bebb89aa46bc6bce3920a10bb2afbc9d7dc877d /clang/lib/AST | |
parent | 492f1cc8c78c9a5e0611fdd2ab26fa213f85e4bd (diff) | |
download | bcm5719-llvm-34f9d3fe2ac63a50a237809236880dd34953ecd6.tar.gz bcm5719-llvm-34f9d3fe2ac63a50a237809236880dd34953ecd6.zip |
[AST] namespace ns { extern "C" { int X; }} prints as "ns::X", not as "X"
llvm-svn: 324081
Diffstat (limited to 'clang/lib/AST')
-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(); } |