Skip to content

Commit d87d707

Browse files
committed
Add a mangling for lambda-expressions (which can now appear in
unevaluated operands and therefore in function signatures).
1 parent 3ebf3e6 commit d87d707

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

abi.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5246,6 +5246,7 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
52465246
::= L &lt;<i>nullptr</i> <a href="#mangle.type">type</a>&gt; E # nullptr literal (i.e., "LDnE")
52475247
::= L &lt;<i>pointer</i> <a href="#mangle.type">type</a>&gt; 0 E # null pointer template argument
52485248
::= L &lt;<a href="#mangle.type">type</a>&gt; &lt;<i>real-part</i> <a href="#mangle.float">float</a>&gt; _ &lt;<i>imag-part</i> <a href="#mangle.float">float</a>&gt; E # complex floating point literal (C 2000)
5249+
::= L &lt;<i>lambda</i> <a href="#mangle.closure-type-name">closure-type-name</a>&gt; E # lambda expression
52495250
::= L _Z &lt;<a href="#mangle.encoding">encoding</a>&gt; E # external name
52505251

52515252
&lt;<a name="mangle.braced-expression">braced-expression</a>&gt; ::= &lt;<a href="#mangle.expression">expression</a>&gt;
@@ -5265,6 +5266,16 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
52655266
(e.g., <code>::x</code>).
52665267
</p>
52675268

5269+
<p>When a lambda expression appears in the type of a function template at namespace scope,
5270+
that function template cannot be redeclared in other translation units,
5271+
so this ABI does not constrain its mangling except that it cannot collide
5272+
with symbols in other translation units.
5273+
When a lambda expression appears in an instantiation-dependent expression
5274+
in other contexts (for example, in the signature of a function template at class scope),
5275+
it is mangled as a &lt;<a href="#mangle.closure-type-name">closure-type-name</a>&gt;,
5276+
excluding any name prefix, but including its number within its context.
5277+
The context is implied by the remaining portion of the encoding.</p>
5278+
52685279
<p><code>tl</code> is used for direct-list-initializations, where the type name is directly followed by a braced-init-list; e.g., <code>MyArray{1,2,3}</code> should be mangled <code>tl7MyArrayLi1ELi2ELi3EE</code>. If the braced-init-list is parenthesized, this is not a direct-list-initialization, and it should be mangled with <code>cv</code> and a nested <code>il</code>; for example, <code>MyArray({1,2,3})</code> should be mangled <code>cv7MyArrayilLi1ELi2ELi3EE</code>.</p>
52695280

52705281
<p>If an implementation supports the full C99 designated initializer syntax (as an extension), a designator list comprising multiple designators results in

0 commit comments

Comments
 (0)