summaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index f34bc5b..f2dce53 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -35,16 +35,21 @@ context (context& c)
void namespace_::
traverse (type& ns)
{
- string name (ns.name ());
+ // Only traverse namespaces from the main file.
+ //
+ if (ns.file () == unit.file ())
+ {
+ string name (ns.name ());
- if (name.empty ())
- os << "namespace";
- else
- os << "namespace " << name;
+ if (name.empty ())
+ os << "namespace";
+ else
+ os << "namespace " << name;
- os << "{";
+ os << "{";
- traversal::namespace_::traverse (ns);
+ traversal::namespace_::traverse (ns);
- os << "}";
+ os << "}";
+ }
}