Skip to content

Commit 5972f64

Browse files
committed
SFINAE substitutions reset NestedNameSpecifier
#fix fix #774
1 parent e66e662 commit 5972f64

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

src/lib/AST/TerminalTypeVisitor.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class TerminalTypeVisitor
8585
bool IsPack_ = false;
8686

8787
// The optional NestedNameSpecifier.
88-
const NestedNameSpecifier* NNS_;
88+
const NestedNameSpecifier* NNS_ = nullptr;
8989

9090
public:
9191
/** Constructor for TerminalTypeVisitor.
@@ -570,7 +570,8 @@ class TerminalTypeVisitor
570570
{
571571
if (auto SFINAE = getASTVisitor().extractSFINAEInfo(T))
572572
{
573-
return getDerived().Visit(SFINAE->first);
573+
NNS_ = nullptr;
574+
return getDerived().Visit(SFINAE->Type);
574575
}
575576

576577
if (auto const* NNS = T->getQualifier())
@@ -604,7 +605,8 @@ class TerminalTypeVisitor
604605
MRDOCS_SYMBOL_TRACE(T, Visitor_.context_);
605606
if (auto SFINAE = getASTVisitor().extractSFINAEInfo(T))
606607
{
607-
return getDerived().Visit(SFINAE->first);
608+
NNS_ = nullptr;
609+
return getDerived().Visit(SFINAE->Type);
608610
}
609611

610612
// In most cases, a template name is simply a reference

test-files/golden-tests/core/libcxx.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Declared in `<libcxx.cpp>`
3434
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
3535
----
3636
template<typename T>
37-
<<std,std>>::T
37+
T
3838
sqrt(T value);
3939
----
4040

test-files/golden-tests/core/libcxx.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>Synopsis</h3>
4040
<pre>
4141
<code class="source-code cpp">
4242
template&lt;typename T&gt;
43-
<a href="#std">std</a>::T
43+
T
4444
sqrt(T value);
4545
</code>
4646
</pre>

test-files/golden-tests/core/libcxx.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<function name="sqrt" id="ulFDUE1svTCX8fV/h8EIp4NNbWs=">
88
<file path="libcxx.cpp" line="149"/>
99
<return>
10-
<type name="std::T"/>
10+
<type name="T"/>
1111
</return>
1212
<param name="value">
1313
<type name="T"/>

test-files/golden-tests/snippets/sqrt.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Declared in `&lt;sqrt&period;cpp&gt;`
3434
[source,cpp,subs="verbatim,replacements,macros,-callouts"]
3535
----
3636
template&lt;typename T&gt;
37-
<<std,std>>::T
37+
T
3838
sqrt(T value);
3939
----
4040

test-files/golden-tests/snippets/sqrt.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h3>Synopsis</h3>
4040
<pre>
4141
<code class="source-code cpp">
4242
template&lt;typename T&gt;
43-
<a href="#std">std</a>::T
43+
T
4444
sqrt(T value);
4545
</code>
4646
</pre>

test-files/golden-tests/snippets/sqrt.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<function name="sqrt" id="ulFDUE1svTCX8fV/h8EIp4NNbWs=">
88
<file path="sqrt.cpp" line="15" class="def"/>
99
<return>
10-
<type name="std::T"/>
10+
<type name="T"/>
1111
</return>
1212
<param name="value">
1313
<type name="T"/>

0 commit comments

Comments
 (0)