summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-15 18:44:29 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-15 18:45:32 (GMT)
commit29edb122e53ee80201a7e535f6e26f161de86a47 (patch)
treeed52862f8c48dcd84f0c1f3bec4ffd3de3c72fe7 /src
parent40aed5c681c2355614d00b77f9eb372a77fa6a30 (diff)
downloadCastXML-29edb122e53ee80201a7e535f6e26f161de86a47.zip
CastXML-29edb122e53ee80201a7e535f6e26f161de86a47.tar.gz
CastXML-29edb122e53ee80201a7e535f6e26f161de86a47.tar.bz2
Output: Do not generate name="" attribute on anonymous namespaces
Be consistent with gccxml which did not generate the attribute.
Diffstat (limited to 'src')
-rw-r--r--src/Output.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Output.cxx b/src/Output.cxx
index 374f1c3..709c5b8 100644
--- a/src/Output.cxx
+++ b/src/Output.cxx
@@ -1373,7 +1373,10 @@ void ASTVisitor::OutputNamespaceDecl(
{
this->OS << " <Namespace";
this->PrintIdAttribute(dn);
- this->PrintNameAttribute(d->getName().str());
+ std::string name = d->getName().str();
+ if (!name.empty()) {
+ this->PrintNameAttribute(name);
+ }
this->PrintContextAttribute(d);
if(dn->Complete) {
std::set<DumpId> emitted;