Skip to content

Commit

Permalink
namespace aliases support prefix
Browse files Browse the repository at this point in the history
#fix
  • Loading branch information
alandefreitas committed Jan 2, 2025
1 parent 56f175a commit 499c541
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,9 +1334,11 @@ populate(
NamespaceAliasDecl* D)
{
NamedDecl const* Aliased = D->getAliasedNamespace();
I.AliasedSymbol = toNameInfo(Aliased);
NestedNameSpecifier const* NNS = D->getQualifier();
I.AliasedSymbol = toNameInfo(Aliased, {}, NNS);
}


void
ASTVisitor::
populate(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
= Reference
:mrdocs:

[#index]
== Global namespace


=== Namespaces

[cols=1]
|===
| Name

| <<B,`B`>>
|===

[#B]
== B


=== Namespaces

[cols=1]
|===
| Name

| <<B-U,`U`>>
|===

[#B-U]
== <<B,B>>::U


=== Namespace Aliases

[cols=1]
|===
| Name

| <<B-U-E,`E`>>
|===

[#B-U-E]
== <<B,B>>::<<B-U,U>>::E


=== Synopsis


Declared in `&lt;excluded&hyphen;namespace&hyphen;alias&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
namespace E = <<B,B>>::S::E;
----



[.small]#Created with https://www.mrdocs.com[MrDocs]#
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace B {
namespace S {
namespace E {}
}

namespace U {
namespace E = B::S::E;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<html lang="en">
<head>
<title>Reference</title>
</head>
<body>
<div>
<h1>Reference</h1>
<div>
<div>
<h2 id="index">Global namespace</h2>
</div>
<h2>Namespaces</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#B"><code>B</code></a> </td></tr>
</tbody>
</table>
</div>
<div>
<div>
<h2 id="B">B</h2>
</div>
<h2>Namespaces</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#B-U"><code>U</code></a> </td></tr>
</tbody>
</table>
</div>
<div>
<div>
<h2 id="B-U"><a href="#B">B</a>::U</h2>
</div>
<h2>Namespace Aliases</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#B-U-E"><code>E</code></a> </td></tr>
</tbody>
</table>
</div>
<div>
<div>
<h2 id="B-U-E"><a href="#B">B</a>::<a href="#B-U">U</a>::E</h2>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;excluded-namespace-alias.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">
namespace E = <a href="#B">B</a>::S::E;
</code>
</pre>
</div>
</div>

</div>
<div>
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?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 name="B" id="kPgq2AM8TvyGDGm5jEWfqYlOPmY=">
<namespace name="S" id="Rj2Fd5N7JujyJxCEKO4hXgEbuZE=">
<namespace name="E" id="3Bv76oUtQq1hnBVVkwioGwKa0oU=">
</namespace>
</namespace>
<namespace name="U" id="X48ZrJbrwHITObLn6vxlcgApA20=">
<namespace-alias name="E" id="TDj0Rc30uD7P5e+F1gsHzHoaV2U=">
<file path="excluded-namespace-alias.cpp" line="7"/>
<aliased name="B::S::E" id="3Bv76oUtQq1hnBVVkwioGwKa0oU="/>
</namespace-alias>
</namespace>
</namespace>
</namespace>
</mrdocs>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include-symbols:
- 'B::U'
- 'B::U::**'
exclude-symbols:
- 'B::S'
- 'B::S::**'

0 comments on commit 499c541

Please sign in to comment.