diff options
author | Brad King <brad.king@kitware.com> | 2015-03-23 17:36:21 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-03-23 17:38:28 (GMT) |
commit | d687d1d00346d81cf51bc9eb177d1c090b608bbe (patch) | |
tree | 2d06ac9366a70de9c4f016f719fbdb7e87c4d9c9 /src | |
parent | 94256f359999905034ff0065b2a7627348c35220 (diff) | |
download | CastXML-d687d1d00346d81cf51bc9eb177d1c090b608bbe.zip CastXML-d687d1d00346d81cf51bc9eb177d1c090b608bbe.tar.gz CastXML-d687d1d00346d81cf51bc9eb177d1c090b608bbe.tar.bz2 |
Output: Traverse namespace redeclarations
A namespace may be redeclared to add more members:
namespace ns { void f1(); }
namespace ns { void f2(); }
Fix our AST traversal to consider members from all redeclarations
of each namespace instead of only the canonical (first) one.
Previously we generated members from later redeclarations only
if they were referenced from other declarations we happened to
encounter.
Reported-by: Michka Popoff <michkapopoff@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/Output.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Output.cxx b/src/Output.cxx index 0d4931b..6299cb8 100644 --- a/src/Output.cxx +++ b/src/Output.cxx @@ -1239,7 +1239,11 @@ void ASTVisitor::OutputNamespaceDecl( this->PrintNameAttribute(d->getName().str()); this->PrintContextAttribute(d); if(dn->Complete) { - this->PrintMembersAttribute(d); + std::set<unsigned int> emitted; + for (clang::NamespaceDecl const* r: d->redecls()) { + this->AddDeclContextMembers(r, emitted); + } + this->PrintMembersAttribute(emitted); } this->OS << "/>\n"; } |