Skip to content

Commit 9aba465

Browse files
committed
Add numbering rule for lambdas in class bodies outside of default
arguments and default member initializers.
1 parent d87d707 commit 9aba465

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

abi.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5570,6 +5570,7 @@ <h4><a href="#closure-types">5.1.8 Closure Types (Lambdas)</a></h4>
55705570
<li>default member initializers</li>
55715571
<li>the bodies of inline or templated functions</li>
55725572
<li>the initializers of inline or templated variables</li>
5573+
<li>the remaining contexts in class definitions</li>
55735574
</ul>
55745575

55755576
In all these contexts, the encoding of the closure types builds on an
@@ -5658,6 +5659,28 @@ <h4><a href="#closure-types">5.1.8 Closure Types (Lambdas)</a></h4>
56585659
// Corresponding operator(): _ZNK1SIiE1xMUlvE_clEv
56595660
</pre></code>
56605661

5662+
<p>
5663+
If the context is within a class definition,
5664+
and not within one of the above more specific cases,
5665+
the closure class and its members are encoded as follows:
5666+
<code><pre><font color=blue> &lt;<a href="#mangle.local-name">local-name</a>&gt; ::= Z &lt;<i>class</i> <a href="#mangle.name">name</a>&gt; E &lt;<i>entity</i> <a href="#mangle.name">name</a>&gt;
5667+
</font></pre></code>
5668+
As above, the <code>&lt;<i>entity</i> <a href="#mangle.name">name</a>&gt;</code> will contain a
5669+
<code>&lt;<a href="#mangle.closure-type-name">closure-type-name</a>&gt;</code>,
5670+
which is numbered within the class, counting only those closure types for which
5671+
this mangling rule applies.
5672+
For example:
5673+
<code><pre>
5674+
struct S {
5675+
// Template argument is LZ1SEUlvE_E; f&lt;true&gt; is _ZN1S1fILb1EEEv1XILZ1SEUlvE_EE
5676+
template&lt;bool B&gt; void f(X&lt;[]{ return B; }()&gt;) { ... }
5677+
int n = []{ return 0; }(); // not counted towards numbering in struct S
5678+
// Template argument is LZ1SEUlvE0_E; f&lt;true&gt; is _ZN1S1fILb1EEEv1XILZ1SEUlvE0_EE
5679+
template&lt;bool B&gt; void f(X&lt;[]{ return !B; }()&gt;) { ... }
5680+
};
5681+
</pre></code>
5682+
5683+
56615684
<p>
56625685
In a generic lambda, uses of <code>auto</code> in the parameter list
56635686
are mangled as the corresponding artificial template type parameter.

0 commit comments

Comments
 (0)