Skip to content

Commit 88a1ceb

Browse files
committed
test: test cases for all using declaration variants
1 parent b10b8aa commit 88a1ceb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3448
-58
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
= Reference
2+
:mrdocs:
3+
4+
[#index]
5+
== Global namespace
6+
7+
=== Namespaces
8+
9+
[cols=1]
10+
|===
11+
| Name
12+
| link:#A[`A`]
13+
|===
14+
15+
=== Functions
16+
17+
[cols=1]
18+
|===
19+
| Name
20+
| link:#f[`f`]
21+
|===
22+
23+
[#A]
24+
== A
25+
26+
=== Enums
27+
28+
[cols=1]
29+
|===
30+
| Name
31+
| link:#A-E[`E`]
32+
|===
33+
34+
[#A-E]
35+
== link:#A[A]::E
36+
37+
=== Synopsis
38+
39+
Declared in `<using‐enum‐in‐ns.cpp>`
40+
41+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
42+
----
43+
enum class E : int;
44+
----
45+
46+
=== Members
47+
48+
49+
[cols=2]
50+
|===
51+
| Name
52+
| Description
53+
|`e1`
54+
|The constant to be introduced
55+
|===
56+
57+
[#f]
58+
== f
59+
60+
=== Synopsis
61+
62+
Declared in `<using‐enum‐in‐ns.cpp>`
63+
64+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
65+
----
66+
void
67+
f();
68+
----
69+
70+
71+
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace A
2+
{
3+
enum class E {
4+
/// The constant to be introduced
5+
e1
6+
};
7+
}
8+
9+
using enum A::E;
10+
11+
void
12+
f()
13+
{
14+
e1; // This should resolve to A::E::e1
15+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<html lang="en">
2+
<head>
3+
<title>Reference</title>
4+
</head>
5+
<body>
6+
<div>
7+
<h1>Reference</h1>
8+
<div>
9+
<div>
10+
<h2 id="index"><a href="#index"></a></h2>
11+
</div>
12+
<h2>Namespaces</h2>
13+
<table style="table-layout: fixed; width: 100%;">
14+
<thead>
15+
<tr>
16+
<th>Name</th>
17+
</tr>
18+
</thead>
19+
<tbody>
20+
<tr>
21+
<td><a href="#A"><code>A</code></a> </td></tr>
22+
</tbody>
23+
</table>
24+
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="#f"><code>f</code></a> </td></tr>
35+
</tbody>
36+
</table>
37+
38+
</div>
39+
<div>
40+
<div>
41+
<h2 id="A"><a href="#A">A</a></h2>
42+
</div>
43+
<h2>Enums</h2>
44+
<table style="table-layout: fixed; width: 100%;">
45+
<thead>
46+
<tr>
47+
<th>Name</th>
48+
</tr>
49+
</thead>
50+
<tbody>
51+
<tr>
52+
<td><a href="#A-E"><code>E</code></a> </td></tr>
53+
</tbody>
54+
</table>
55+
56+
</div>
57+
<div>
58+
<div>
59+
<h2 id="A-E"><a href="#A-E">A::E</a></h2>
60+
</div>
61+
<div>
62+
<h3>Synopsis</h3>
63+
<div>
64+
Declared in <code>&lt;using-enum-in-ns.cpp&gt;</code></div>
65+
<pre>
66+
<code class="source-code cpp">
67+
enum class E : int;
68+
</code>
69+
</pre>
70+
</div>
71+
<div>
72+
<h3>Members</h3>
73+
<table>
74+
<thead>
75+
<tr>
76+
<th>Name</th>
77+
<th>Description</th>
78+
</tr>
79+
</thead>
80+
<tbody>
81+
<tr>
82+
<td>e1</td>
83+
<td><span>The constant to be introduced</span></td>
84+
</tr>
85+
</tbody>
86+
</table>
87+
</div>
88+
</div>
89+
<div>
90+
<div>
91+
<h2 id="f"><a href="#f">f</a></h2>
92+
</div>
93+
<div>
94+
<h3>Synopsis</h3>
95+
<div>
96+
Declared in <code>&lt;using-enum-in-ns.cpp&gt;</code></div>
97+
<pre>
98+
<code class="source-code cpp">
99+
void
100+
f();
101+
</code>
102+
</pre>
103+
</div>
104+
</div>
105+
106+
</div>
107+
<div>
108+
<h4>Created with <a href="https://www.mrdocs.com">MrDocs</a></h4>
109+
</div>
110+
</body>
111+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mrdocs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://github.com/cppalliance/mrdocs/raw/develop/mrdocs.rnc">
4+
<namespace id="//////////////////////////8=">
5+
<namespace name="A" id="jQQu/8mLNzRQvGtbkKMwwloVDpw=">
6+
<enum name="E" class="scoped" id="a5uhL/8g9ACd/JSUdADFNrjlrmA=">
7+
<base>
8+
<type name="int"/>
9+
</base>
10+
<file short-path="using-enum-in-ns.cpp" source-path="using-enum-in-ns.cpp" line="3" class="def"/>
11+
<enum-constant name="e1" initializer="0" id="wwbsykALj7y7OWYYyP6gTbo876U=">
12+
<file short-path="using-enum-in-ns.cpp" source-path="using-enum-in-ns.cpp" line="5"/>
13+
<doc>
14+
<brief>
15+
<text>The constant to be introduced</text>
16+
</brief>
17+
</doc>
18+
</enum-constant>
19+
</enum>
20+
</namespace>
21+
<function name="f" id="s6nsa+zVhpzzrN+yUVPP5rvdXqs=">
22+
<file short-path="using-enum-in-ns.cpp" source-path="using-enum-in-ns.cpp" line="11" class="def"/>
23+
</function>
24+
</namespace>
25+
</mrdocs>
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
= Reference
2+
:mrdocs:
3+
4+
[#index]
5+
== Global namespace
6+
7+
=== Namespaces
8+
9+
[cols=1]
10+
|===
11+
| Name
12+
| link:#A[`A`]
13+
|===
14+
15+
=== Types
16+
17+
[cols=1]
18+
|===
19+
| Name
20+
| link:#B[`B`]
21+
|===
22+
23+
=== Functions
24+
25+
[cols=1]
26+
|===
27+
| Name
28+
| link:#g[`g`]
29+
|===
30+
31+
[#A]
32+
== A
33+
34+
=== Enums
35+
36+
[cols=1]
37+
|===
38+
| Name
39+
| link:#A-E[`E`]
40+
|===
41+
42+
[#A-E]
43+
== link:#A[A]::E
44+
45+
=== Synopsis
46+
47+
Declared in `&lt;using&hyphen;enum&hyphen;in&hyphen;record&period;cpp&gt;`
48+
49+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
50+
----
51+
enum class E : int;
52+
----
53+
54+
=== Members
55+
56+
57+
[cols=2]
58+
|===
59+
| Name
60+
| Description
61+
|`e1`
62+
|The constant to be introduced
63+
|===
64+
65+
[#B]
66+
== B
67+
68+
=== Synopsis
69+
70+
Declared in `&lt;using&hyphen;enum&hyphen;in&hyphen;record&period;cpp&gt;`
71+
72+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
73+
----
74+
class B;
75+
----
76+
77+
[#g]
78+
== g
79+
80+
=== Synopsis
81+
82+
Declared in `&lt;using&hyphen;enum&hyphen;in&hyphen;record&period;cpp&gt;`
83+
84+
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
85+
----
86+
void
87+
g();
88+
----
89+
90+
91+
[.small]#Created with https://www.mrdocs.com[MrDocs]#
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace A
2+
{
3+
enum class E {
4+
/// The constant to be introduced
5+
e1
6+
};
7+
}
8+
9+
class B {
10+
public:
11+
using enum A::E; // This should resolve to A::E::e1
12+
};
13+
14+
void
15+
g()
16+
{
17+
B::e1;
18+
}

0 commit comments

Comments
 (0)