Skip to content

Commit 72e84eb

Browse files
authored
Merge pull request #36 from zygoloid/period-suffix
Update name mangling description to explicitly condone the practice o…
2 parents 6d7a587 + 0416146 commit 72e84eb

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

abi.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4052,8 +4052,9 @@ <h4><a href="#mangling-general"> 5.1.1 General </a></h4>
40524052
or <code>Type?</code> for an unknown data type.
40534053

40544054
<p>
4055-
Grammar productions beginning with '$' are reserved for private implementation
4056-
use. Names produced using such extensions are inherently non-portable.
4055+
Mangled names containing '<tt>$</tt>' or '<tt>.</tt>' are reserved for
4056+
private implementation use. Names produced using such extensions are
4057+
inherently non-portable and should be given internal linkage where possible.
40574058

40584059
<p>
40594060
<a name="mangling-structure">
@@ -4064,6 +4065,7 @@ <h4><a href="#mangling-structure"> 5.1.2 General Structure </a></h4>
40644065
Mangled names have the general structure:
40654066
<pre><font color=blue><code>
40664067
&lt;<a name="mangle.mangled-name">mangled-name</a>&gt; ::= _Z &lt;<a href="#mangle.encoding">encoding</a>&gt;
4068+
::= _Z &lt;<a href="#mangle.encoding">encoding</a>&gt; . &lt;vendor-specific suffix&gt;
40674069
&lt;<a name="mangle.encoding">encoding</a>&gt; ::= &lt;<i>function</i> <a href="#mangle.name">name</a>&gt; &lt;<a href="#mangle.bare-function-type">bare-function-type</a>&gt;
40684070
::= &lt;<i>data</i> <a href="#mangle.name">name</a>&gt;
40694071
::= &lt;<a href="#mangle.special-name">special-name</a>&gt;
@@ -4081,6 +4083,13 @@ <h4><a href="#mangling-structure"> 5.1.2 General Structure </a></h4>
40814083
parameters).
40824084
The type is omitted for variables and static data members.
40834085

4086+
<p>
4087+
A <code>&lt;<a href="#mangle.mangled-name">mangled-name</a>&gt;</code>
4088+
containing a period represents a vendor-specific version or portion
4089+
of the entity named by the <code>&lt;<a href="#mangle.encoding">encoding</a>&gt;</code>
4090+
prior to the first period. There is no restriction on the characters
4091+
that may be used in the suffix following the period.
4092+
40844093
<a name="mangle.anonymous">
40854094
<h5><a href="#mangling.anonymous">Anonymous entities</a></h5>
40864095

@@ -5167,7 +5176,7 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
51675176
::= L &lt;<i>nullptr</i> <a href="#mangle.type">type</a>&gt; E # nullptr literal (i.e., "LDnE")
51685177
::= L &lt;<i>pointer</i> <a href="#mangle.type">type</a>&gt; 0 E # null pointer template argument
51695178
::= 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)
5170-
::= L &lt;<a href="#mangle.mangled-name">mangled-name</a>&gt; E # external name
5179+
::= L _Z &lt;<a href="#mangle.encoding">encoding</a>&gt; E # external name
51715180

51725181
&lt;<a name="mangle.braced-expression">braced-expression</a>&gt; ::= &lt;<a href="#mangle.expression">expression</a>&gt;
51735182
::= di &lt;<i>field</i> <a href="#mangle.source-name">source-name</a>&gt; &lt;<a href="#mangle.braced-expression">braced-expression</a>&gt; # .name = expr
@@ -5253,7 +5262,7 @@ <h5><a href="#mangling.declaration-reference">5.1.6.2 References to declared ent
52535262
<p>
52545263
When encoding template signatures, a name appearing in the source code
52555264
cannot always be resolved to a specific entity: In such cases the
5256-
<code>&lt;<a href="#mangle.mangled-name">mangled-name</a>&gt;</code> production (via
5265+
<code>&lt;<a href="#mangle.encoding">encoding</a>&gt;</code> production (via
52575266
<code>&lt;<a href="#mangle.expr-primary">expr-primary</a>&gt;</code>) does not apply, and instead the
52585267
<code>&lt;<a href="#mangle.unresolved-name">unresolved-name</a>&gt;</code> encoding is used. For example:
52595268
<code><pre>

0 commit comments

Comments
 (0)