Skip to content

Commit

Permalink
fix: global namespace is always created
Browse files Browse the repository at this point in the history
  • Loading branch information
fpelliccioni authored and alandefreitas committed Jun 24, 2024
1 parent c8b9e8f commit 81318c8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,9 @@ class ASTVisitor
// dependencies will be tracked, but not extracted
traverseDecl(context_.getTranslationUnitDecl());

// This is to ensure that the global namespace is always present
getOrCreateInfo<NamespaceInfo>(SymbolID::global);

// if dependency extraction is disabled, we are done
if(config_->referencedDeclarations ==
ConfigImpl::SettingsImpl::ExtractPolicy::Never)
Expand Down
1 change: 1 addition & 0 deletions test-files/golden-tests/empty.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

6 changes: 6 additions & 0 deletions test-files/golden-tests/empty.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
<namespace id="//////////////////////////8=">
</namespace>
</mrdocs>

0 comments on commit 81318c8

Please sign in to comment.