Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,6 @@ populate(
RecordInfo& I,
CXXRecordDecl const* D)
{
// Unnamed structs and classes are implementation-defined
// or dependencies at best. There are never pages for them.
if (D->getIdentifier() == nullptr)
{
I.Extraction = mostSpecific(
ExtractionMode::ImplementationDefined,
I.Extraction);
}

if (D->getTypedefNameForAnonDecl())
{
I.IsTypeDef = true;
Expand Down
123 changes: 121 additions & 2 deletions test-files/golden-tests/symbols/record/unnamed.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,102 @@
[#index]
== Global namespace

=== Types

[cols=2]
|===
| Name
| Description
| link:#_01record-01[`Unnamed struct`]
|
| link:#_01record-0f[`Unnamed struct`]
| A test unnamed class.
|===

=== Variables

[cols=1]
[cols=2]
|===
| Name
| Description
| link:#F[`F`]
|
| link:#x[`x`]
| A test variable named 'x'
| link:#y[`y`]
| A test variable named 'y'
|===

[#_01record-01]
== Unnamed struct

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Unnamed struct;
----

=== Member Functions

[cols=1]
|===
| Name
| link:#_01record-01-operator_call[`operator()`]
|===

[#_01record-01-operator_call]
== operator()

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
operator()() const;
----

[#_01record-0f]
== Unnamed struct

A test unnamed class.

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct Unnamed struct;
----

=== Data Members

[cols=2]
|===
| Name
| Description
| link:#_01record-0f-a[`a`]
| A test field.
|===

[#_01record-0f-a]
== a

A test field.

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int a;
----

[#F]
== F
Expand All @@ -21,7 +110,37 @@ Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr /* implementation-defined */ F = {};
constexpr link:#_01record-01[] F = {};
----

[#x]
== x

A test variable named 'x'

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
extern
link:#_01record-0f[] x;
----

[#y]
== y

A test variable named 'y'

=== Synopsis

Declared in `<unnamed.cpp>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
extern
link:#_01record-0f[] y;
----


Expand Down
10 changes: 10 additions & 0 deletions test-files/golden-tests/symbols/record/unnamed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,13 @@ constexpr struct
{
void operator()() const;
} const F{};

/// A test unnamed class.
extern struct {
/// A test field.
int a;
}
/// A test variable named 'x'
x,
/// A test variable named 'y'
y;
162 changes: 160 additions & 2 deletions test-files/golden-tests/symbols/record/unnamed.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,137 @@ <h1>Reference</h1>
<div>
<h2 id="index"><a href="#index"></a></h2>
</div>
<h2>Types</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#_01record-01"><code>Unnamed struct</code></a> </td><td><span></span></td></tr><tr>
<td><a href="#_01record-0f"><code>Unnamed struct</code></a> </td><td><span>A test unnamed class.</span></td></tr>
</tbody>
</table>

<h2>Variables</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#F"><code>F</code></a> </td><td><span></span></td></tr><tr>
<td><a href="#x"><code>x</code></a> </td><td><span>A test variable named &#x27;x&#x27;</span></td></tr><tr>
<td><a href="#y"><code>y</code></a> </td><td><span>A test variable named &#x27;y&#x27;</span></td></tr>
</tbody>
</table>

</div>
<div>
<div>
<h2 id="_01record-01"><a href="#_01record-01"></a></h2>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">struct Unnamed struct;

</code>
</pre>
</div>
<h2>Member Functions</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#F"><code>F</code></a> </td></tr>
<td><a href="#_01record-01-operator_call"><code>operator()</code></a> </td></tr>
</tbody>
</table>



</div>
<div>
<div>
<h2 id="_01record-01-operator_call"><a href="#_01record-01-operator_call">::operator()</a></h2>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">void
operator()() const;

</code>
</pre>
</div>
</div>
<div>
<div>
<h2 id="_01record-0f"><a href="#_01record-0f"></a></h2>
<div>
<span>A test unnamed class.</span>

</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">struct Unnamed struct;

</code>
</pre>
</div>
<h2>Data Members</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#_01record-0f-a"><code>a</code></a> </td><td><span>A test field.</span></td></tr>
</tbody>
</table>



</div>
<div>
<div>
<h2 id="_01record-0f-a"><a href="#_01record-0f-a">::a</a></h2>
<div>
<span>A test field.</span>

</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">int a;

</code>
</pre>
</div>
</div>
<div>
<div>
Expand All @@ -32,7 +150,47 @@ <h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">constexpr /* implementation-defined */ F = {};
<code class="source-code cpp">constexpr <a href="#_01record-01"></a> F = {};

</code>
</pre>
</div>
</div>
<div>
<div>
<h2 id="x"><a href="#x">x</a></h2>
<div>
<span>A test variable named &#x27;x&#x27;</span>

</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">extern
<a href="#_01record-0f"></a> x;

</code>
</pre>
</div>
</div>
<div>
<div>
<h2 id="y"><a href="#y">y</a></h2>
<div>
<span>A test variable named &#x27;y&#x27;</span>

</div>
</div>
<div>
<h3>Synopsis</h3>
<div>
Declared in <code>&lt;unnamed.cpp&gt;</code></div>
<pre>
<code class="source-code cpp">extern
<a href="#_01record-0f"></a> y;

</code>
</pre>
Expand Down
Loading
Loading