Skip to content

Commit 9253fd8

Browse files
committed
test: using declaration shadows only include previous declarations
1 parent f936346 commit 9253fd8

File tree

4 files changed

+91
-10
lines changed

4 files changed

+91
-10
lines changed

test-files/golden-tests/symbols/using/using-function-after.adoc

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414

1515
=== Using Declarations
1616

17-
[cols=1]
17+
[cols=2]
1818
|===
1919
| Name
20+
| Description
2021
| link:#f[`f`]
22+
| f overloads are also available in the global namespace
2123
|===
2224

2325
[#A]
@@ -30,16 +32,20 @@
3032
| Name
3133
| Description
3234
| link:#A-f-08[`f`]
33-
|
35+
| `f` overloads
3436
|===
3537

3638
[#A-f-08]
3739
== link:#A[A]::f
3840

41+
`f` overloads
42+
3943
=== Synopses
4044

4145
Declared in `<using‐function‐after.cpp>`
4246

47+
A non‐shadowing declaration
48+
4349

4450
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
4551
----
@@ -49,6 +55,8 @@ link:#A-f-00[f](char);
4955

5056
[.small]#link:#A-f-00[_» more..._]#
5157

58+
A shadow declaration
59+
5260

5361
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
5462
----
@@ -61,6 +69,8 @@ link:#A-f-01[f](int);
6169
[#A-f-00]
6270
== link:#A[A]::f
6371

72+
A non‐shadowing declaration
73+
6474
=== Synopsis
6575

6676
Declared in `<using‐function‐after.cpp>`
@@ -71,9 +81,17 @@ void
7181
f(char);
7282
----
7383

84+
=== Description
85+
86+
This declaration is not part of the shadow declarations of the using directive because it comes after it.
87+
88+
Only the declarations at the point of the using directive are considered for shadowing in the documentation.
89+
7490
[#A-f-01]
7591
== link:#A[A]::f
7692

93+
A shadow declaration
94+
7795
=== Synopsis
7896

7997
Declared in `<using‐function‐after.cpp>`
@@ -87,6 +105,8 @@ f(int);
87105
[#f]
88106
== f
89107

108+
f overloads are also available in the global namespace
109+
90110
=== Synopsis
91111

92112
Declared in `<using‐function‐after.cpp>`
@@ -98,10 +118,12 @@ using A::f;
98118

99119
=== Introduced Symbols
100120

101-
[cols=1]
121+
[cols=2]
102122
|===
103123
| Name
124+
| Description
104125
| link:#A-f-01[A::f]
126+
| A shadow declaration
105127
|===
106128

107129
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
namespace A
22
{
3+
/// A shadow declaration
34
void f(int);
45
}
56

7+
/// f overloads are also available in the global namespace
68
using A::f;
79

810
namespace A
911
{
12+
/** A non-shadowing declaration
13+
14+
This declaration is not part
15+
of the shadow declarations
16+
of the using directive because
17+
it comes after it.
18+
19+
Only the declarations at
20+
the point of the using directive
21+
are considered for shadowing in the
22+
documentation.
23+
*/
1024
void f(char);
1125
}

test-files/golden-tests/symbols/using/using-function-after.html

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ <h2>Using Declarations</h2>
2727
<thead>
2828
<tr>
2929
<th>Name</th>
30+
<th>Description</th>
3031
</tr>
3132
</thead>
3233
<tbody>
3334
<tr>
34-
<td><a href="#f"><code>f</code></a> </td></tr>
35+
<td><a href="#f"><code>f</code></a> </td><td><span>f overloads are also available in the global namespace</span></td></tr>
3536
</tbody>
3637
</table>
3738

@@ -50,28 +51,32 @@ <h2>Functions</h2>
5051
</thead>
5152
<tbody>
5253
<tr>
53-
<td><a href="#A-f-08"><code>f</code></a> </td><td><span></span></td></tr>
54+
<td><a href="#A-f-08"><code>f</code></a> </td><td><span><code>f</code> overloads</span></td></tr>
5455
</tbody>
5556
</table>
5657

5758
</div>
5859
<div>
5960
<div>
6061
<h2 id="A-f-08"><a href="#A-f-08">A::f</a></h2>
62+
<div>
63+
<span><code>f</code> overloads</span>
64+
65+
</div>
6166
</div>
6267
<div>
6368
<h3>Synopses</h3>
6469
<div>
6570
Declared in <code>&lt;using-function-after.cpp&gt;</code></div>
66-
71+
<span>A non-shadowing declaration</span>
6772
<pre>
6873
<code class="source-code cpp">
6974
void
7075
<a href="#A-f-00">f</a>(char);
7176
</code>
7277
</pre><span class="small"><a href="#A-f-00"><em>» more...</em></a></span>
7378

74-
79+
<span>A shadow declaration</span>
7580
<pre>
7681
<code class="source-code cpp">
7782
void
@@ -85,6 +90,10 @@ <h3>Synopses</h3>
8590
<div>
8691
<div>
8792
<h2 id="A-f-00"><a href="#A-f-00">A::f</a></h2>
93+
<div>
94+
<span>A non-shadowing declaration</span>
95+
96+
</div>
8897
</div>
8998
<div>
9099
<h3>Synopsis</h3>
@@ -97,10 +106,19 @@ <h3>Synopsis</h3>
97106
</code>
98107
</pre>
99108
</div>
109+
<div>
110+
<h3>Description</h3>
111+
<p>This declaration is not part of the shadow declarations of the using directive because it comes after it.</p>
112+
<p>Only the declarations at the point of the using directive are considered for shadowing in the documentation.</p>
113+
</div>
100114
</div>
101115
<div>
102116
<div>
103117
<h2 id="A-f-01"><a href="#A-f-01">A::f</a></h2>
118+
<div>
119+
<span>A shadow declaration</span>
120+
121+
</div>
104122
</div>
105123
<div>
106124
<h3>Synopsis</h3>
@@ -117,6 +135,10 @@ <h3>Synopsis</h3>
117135
<div>
118136
<div>
119137
<h2 id="f"><a href="#f">f</a></h2>
138+
<div>
139+
<span>f overloads are also available in the global namespace</span>
140+
141+
</div>
120142
</div>
121143
<div>
122144
<h3>Synopsis</h3>
@@ -134,11 +156,13 @@ <h3>Introduced Symbols</h3>
134156
<thead>
135157
<tr>
136158
<th>Name</th>
159+
<th>Description</th>
137160
</tr>
138161
</thead>
139162
<tbody>
140163
<tr>
141164
<td><a href="#A-f-01">A::f</a></td>
165+
<td><span>A shadow declaration</span></td>
142166
</tr>
143167
</tbody>
144168
</table>

test-files/golden-tests/symbols/using/using-function-after.xml

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,41 @@
44
<namespace id="//////////////////////////8=">
55
<namespace name="A" id="jQQu/8mLNzRQvGtbkKMwwloVDpw=">
66
<function name="f" id="Bt/dVoQvE7M4sJbKQH+g/hiv0Os=">
7-
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="10"/>
7+
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="24"/>
88
<param>
99
<type name="char"/>
1010
</param>
11+
<doc>
12+
<brief>
13+
<text>A non-shadowing declaration</text>
14+
</brief>
15+
<para>
16+
<text>This declaration is not part of the shadow declarations of the using directive because it comes after it.</text>
17+
</para>
18+
<para>
19+
<text>Only the declarations at the point of the using directive are considered for shadowing in the documentation.</text>
20+
</para>
21+
</doc>
1122
</function>
1223
<function name="f" id="FuaTgMW0VtO+b4uzr/DCmx9vlb0=">
13-
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="3"/>
24+
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="4"/>
1425
<param>
1526
<type name="int"/>
1627
</param>
28+
<doc>
29+
<brief>
30+
<text>A shadow declaration</text>
31+
</brief>
32+
</doc>
1733
</function>
1834
</namespace>
1935
<using id="FhSdC4kR2+KOxLCiCUQ9mu1WNoY=" class="using" qualifier="A::f">
20-
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="6"/>
36+
<file short-path="using-function-after.cpp" source-path="using-function-after.cpp" line="8"/>
37+
<doc>
38+
<brief>
39+
<text>f overloads are also available in the global namespace</text>
40+
</brief>
41+
</doc>
2142
<named id="FuaTgMW0VtO+b4uzr/DCmx9vlb0="/>
2243
</using>
2344
</namespace>

0 commit comments

Comments
 (0)