Skip to content

Commit a7d5cf6

Browse files
committed
test: using declaration with mixed shadows
1 parent 9253fd8 commit a7d5cf6

File tree

4 files changed

+60
-124
lines changed

4 files changed

+60
-124
lines changed

test-files/golden-tests/symbols/using/using-function-and-type.adoc

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -12,52 +12,44 @@
1212
| link:#A[`A`]
1313
|===
1414

15-
=== Functions
16-
17-
[cols=1]
18-
|===
19-
| Name
20-
| link:#g[`g`]
21-
|===
22-
23-
=== Variables
24-
25-
[cols=1]
26-
|===
27-
| Name
28-
| link:#a[`a`]
29-
|===
30-
3115
=== Using Declarations
3216

33-
[cols=1]
17+
[cols=2]
3418
|===
3519
| Name
20+
| Description
3621
| link:#f[`f`]
22+
| A using declaration that shadows a function and the record.
3723
|===
3824

3925
[#A]
4026
== A
4127

4228
=== Types
4329

44-
[cols=1]
30+
[cols=2]
4531
|===
4632
| Name
33+
| Description
4734
| link:#A-f-05[`f`]
35+
| A record
4836
|===
4937

5038
=== Functions
5139

52-
[cols=1]
40+
[cols=2]
5341
|===
5442
| Name
43+
| Description
5544
| link:#A-f-01[`f`]
45+
| A function
5646
|===
5747

5848
[#A-f-05]
5949
== link:#A[A]::f
6050

51+
A record
52+
6153
=== Synopsis
6254

6355
Declared in `<using‐function‐and‐type.cpp>`
@@ -70,18 +62,7 @@ struct f;
7062
[#A-f-01]
7163
== link:#A[A]::f
7264

73-
=== Synopsis
74-
75-
Declared in `<using‐function‐and‐type.cpp>`
76-
77-
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
78-
----
79-
void
80-
f(int);
81-
----
82-
83-
[#g]
84-
== g
65+
A function
8566

8667
=== Synopsis
8768

@@ -90,24 +71,14 @@ Declared in `<using‐function‐and‐type.cpp>`
9071
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
9172
----
9273
void
93-
g();
94-
----
95-
96-
[#a]
97-
== a
98-
99-
=== Synopsis
100-
101-
Declared in `<using‐function‐and‐type.cpp>`
102-
103-
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
104-
----
105-
link:#A-f-05[f] a = a;
74+
f(int);
10675
----
10776

10877
[#f]
10978
== f
11079

80+
A using declaration that shadows a function and the record.
81+
11182
=== Synopsis
11283

11384
Declared in `<using‐function‐and‐type.cpp>`
@@ -119,11 +90,14 @@ using A::f;
11990

12091
=== Introduced Symbols
12192

122-
[cols=1]
93+
[cols=2]
12394
|===
12495
| Name
96+
| Description
12597
| link:#A-f-05[A::f]
98+
| A record
12699
| link:#A-f-01[A::f]
100+
| A function
127101
|===
128102

129103
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
namespace A
22
{
3+
/// A function
34
void f(int);
5+
6+
/// A record
47
struct f {};
58
}
69

7-
// This using declaration will shadow both the function and the type.
10+
/// A using declaration that shadows a function and the record.
811
using A::f;
9-
10-
struct f a;
11-
12-
void
13-
g()
14-
{
15-
f(2);
16-
}
17-
18-

test-files/golden-tests/symbols/using/using-function-and-type.html

Lines changed: 19 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -22,42 +22,17 @@ <h2>Namespaces</h2>
2222
</tbody>
2323
</table>
2424

25-
<h2>Functions</h2>
26-
<table style="table-layout: fixed; width: 100%;">
27-
<thead>
28-
<tr>
29-
<th>Name</th>
30-
</tr>
31-
</thead>
32-
<tbody>
33-
<tr>
34-
<td><a href="#g"><code>g</code></a> </td></tr>
35-
</tbody>
36-
</table>
37-
38-
<h2>Variables</h2>
39-
<table style="table-layout: fixed; width: 100%;">
40-
<thead>
41-
<tr>
42-
<th>Name</th>
43-
</tr>
44-
</thead>
45-
<tbody>
46-
<tr>
47-
<td><a href="#a"><code>a</code></a> </td></tr>
48-
</tbody>
49-
</table>
50-
5125
<h2>Using Declarations</h2>
5226
<table style="table-layout: fixed; width: 100%;">
5327
<thead>
5428
<tr>
5529
<th>Name</th>
30+
<th>Description</th>
5631
</tr>
5732
</thead>
5833
<tbody>
5934
<tr>
60-
<td><a href="#f"><code>f</code></a> </td></tr>
35+
<td><a href="#f"><code>f</code></a> </td><td><span>A using declaration that shadows a function and the record.</span></td></tr>
6136
</tbody>
6237
</table>
6338

@@ -71,11 +46,12 @@ <h2>Types</h2>
7146
<thead>
7247
<tr>
7348
<th>Name</th>
49+
<th>Description</th>
7450
</tr>
7551
</thead>
7652
<tbody>
7753
<tr>
78-
<td><a href="#A-f-05"><code>f</code></a> </td></tr>
54+
<td><a href="#A-f-05"><code>f</code></a> </td><td><span>A record</span></td></tr>
7955
</tbody>
8056
</table>
8157

@@ -84,18 +60,23 @@ <h2>Functions</h2>
8460
<thead>
8561
<tr>
8662
<th>Name</th>
63+
<th>Description</th>
8764
</tr>
8865
</thead>
8966
<tbody>
9067
<tr>
91-
<td><a href="#A-f-01"><code>f</code></a> </td></tr>
68+
<td><a href="#A-f-01"><code>f</code></a> </td><td><span>A function</span></td></tr>
9269
</tbody>
9370
</table>
9471

9572
</div>
9673
<div>
9774
<div>
9875
<h2 id="A-f-05"><a href="#A-f-05">A::f</a></h2>
76+
<div>
77+
<span>A record</span>
78+
79+
</div>
9980
</div>
10081
<div>
10182
<h3>Synopsis</h3>
@@ -113,53 +94,30 @@ <h3>Synopsis</h3>
11394
<div>
11495
<div>
11596
<h2 id="A-f-01"><a href="#A-f-01">A::f</a></h2>
116-
</div>
11797
<div>
118-
<h3>Synopsis</h3>
119-
<div>
120-
Declared in <code>&lt;using-function-and-type.cpp&gt;</code></div>
121-
<pre>
122-
<code class="source-code cpp">
123-
void
124-
f(int);
125-
</code>
126-
</pre>
98+
<span>A function</span>
99+
127100
</div>
128101
</div>
129102
<div>
130-
<div>
131-
<h2 id="g"><a href="#g">g</a></h2>
132-
</div>
133-
<div>
134103
<h3>Synopsis</h3>
135104
<div>
136105
Declared in <code>&lt;using-function-and-type.cpp&gt;</code></div>
137106
<pre>
138107
<code class="source-code cpp">
139108
void
140-
g();
109+
f(int);
141110
</code>
142111
</pre>
143112
</div>
144113
</div>
145114
<div>
146115
<div>
147-
<h2 id="a"><a href="#a">a</a></h2>
148-
</div>
149-
<div>
150-
<h3>Synopsis</h3>
116+
<h2 id="f"><a href="#f">f</a></h2>
151117
<div>
152-
Declared in <code>&lt;using-function-and-type.cpp&gt;</code></div>
153-
<pre>
154-
<code class="source-code cpp">
155-
<a href="#A-f-05">f</a> a = a;
156-
</code>
157-
</pre>
158-
</div>
118+
<span>A using declaration that shadows a function and the record.</span>
119+
159120
</div>
160-
<div>
161-
<div>
162-
<h2 id="f"><a href="#f">f</a></h2>
163121
</div>
164122
<div>
165123
<h3>Synopsis</h3>
@@ -177,14 +135,17 @@ <h3>Introduced Symbols</h3>
177135
<thead>
178136
<tr>
179137
<th>Name</th>
138+
<th>Description</th>
180139
</tr>
181140
</thead>
182141
<tbody>
183142
<tr>
184143
<td><a href="#A-f-05">A::f</a></td>
144+
<td><span>A record</span></td>
185145
</tr>
186146
<tr>
187147
<td><a href="#A-f-01">A::f</a></td>
148+
<td><span>A function</span></td>
188149
</tr>
189150
</tbody>
190151
</table>

test-files/golden-tests/symbols/using/using-function-and-type.xml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@
44
<namespace id="//////////////////////////8=">
55
<namespace name="A" id="jQQu/8mLNzRQvGtbkKMwwloVDpw=">
66
<struct name="f" id="Wr+xSXa6fgvTvu1KeVe+kywbb6w=">
7-
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="4" class="def"/>
7+
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="7" class="def"/>
8+
<doc>
9+
<brief>
10+
<text>A record</text>
11+
</brief>
12+
</doc>
813
</struct>
914
<function name="f" id="FuaTgMW0VtO+b4uzr/DCmx9vlb0=">
10-
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="3"/>
15+
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="4"/>
1116
<param>
1217
<type name="int"/>
1318
</param>
19+
<doc>
20+
<brief>
21+
<text>A function</text>
22+
</brief>
23+
</doc>
1424
</function>
1525
</namespace>
16-
<function name="g" id="43ASI/aC9fCLy8T+1gn7pUdis+g=">
17-
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="12" class="def"/>
18-
</function>
19-
<variable name="a" id="0T4A1DYp6ALL6QIozlBbzBKouxM=" default="a">
20-
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="10" class="def"/>
21-
<type id="Wr+xSXa6fgvTvu1KeVe+kywbb6w=" name="f"/>
22-
</variable>
2326
<using id="bxhJVeOdx2X1I5zWLcdGW41DCTs=" class="using" qualifier="A::f">
24-
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="8"/>
27+
<file short-path="using-function-and-type.cpp" source-path="using-function-and-type.cpp" line="11"/>
28+
<doc>
29+
<brief>
30+
<text>A using declaration that shadows a function and the record.</text>
31+
</brief>
32+
</doc>
2533
<named id="Wr+xSXa6fgvTvu1KeVe+kywbb6w="/>
2634
<named id="FuaTgMW0VtO+b4uzr/DCmx9vlb0="/>
2735
</using>

0 commit comments

Comments
 (0)