Skip to content

Commit 1939463

Browse files
authored
Merge pull request #196 from hubert-reinterpretcast/cp-mangling
Add mangling for a call expression with semantically significant parentheses
2 parents 5418b56 + e12f350 commit 1939463

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

abi.html

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5627,10 +5627,9 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
56275627
In general, expression manglings reflect a prefix traversal of the
56285628
syntactic expression tree, with parentheses omitted. (Parentheses
56295629
may be ignored because they are implicit in the prefix representation
5630-
and typically do not affect semantics. However, a parenthesized
5631-
<code>&lt;<a href="#mangle.unresolved-name">unresolved-name</a>&gt;</code>
5632-
must be mangled differently because the parentheses act to suppress
5633-
argument-dependent lookup.) Unless explicitly stated otherwise, the
5630+
and typically do not affect semantics. However, when parentheses
5631+
are used to suppress argument-dependent lookup, the call expression may
5632+
need to be mangled differently.) Unless explicitly stated otherwise, the
56345633
expression is mangled without constant folding or other
56355634
simplification.
56365635

@@ -5675,6 +5674,7 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
56755674
::= pp_ &lt;<a href="#mangle.expression">expression</a>&gt; # prefix ++
56765675
::= mm_ &lt;<a href="#mangle.expression">expression</a>&gt; # prefix --
56775676
::= cl &lt;<a href="#mangle.expression">expression</a>&gt;+ E # expression (expr-list), call
5677+
::= cp &lt;<a href="#mangle.base-unresolved-name">base-unresolved-name</a>&gt; &lt;<a href="#mangle.expression">expression</a>&gt;* E # (name) (expr-list), call that would use argument-dependent lookup but for the parentheses
56785678
::= cv &lt;<a href="#mangle.type">type</a>&gt; &lt;<a href="#mangle.expression">expression</a>&gt; # type (expression), conversion with one argument
56795679
::= cv &lt;<a href="#mangle.type">type</a>&gt; _ &lt;<a href="#mangle.expression">expression</a>&gt;* E # type (expr-list), conversion with other than one argument
56805680
::= tl &lt;<a href="#mangle.type">type</a>&gt; &lt;<a href="#mangle.braced-expression">braced-expression</a>&gt;* E # type {expr-list}, conversion with braced-init-list argument
@@ -5771,6 +5771,18 @@ <h4><a href="#expressions">5.1.6 Expressions</a></h4>
57715771
<p>If an implementation supports the full C99 designated initializer syntax (as an extension), a designator list comprising multiple designators results in
57725772
multiple nested &lt;<a href="#mangle.braced-expression">braced-expression</a>&gt;s. For example, <code>X{.a.b[3] = 1}</code> should be mangled <code>tl1Xdi1adi1bdxLi3ELi1EE</code>.</p>
57735773

5774+
<p>In C++, a call expression where the callee operand is an unqualified name
5775+
uses argument-dependent lookup unless unqualified lookup finds certain kinds of
5776+
declarations; see C++11 [basic.lookup.argdep]p3. Because this rule does not
5777+
apply when the name is parenthesized, it is sometimes necessary to distinguish
5778+
parenthesized and unparenthesized calls in the mangling, despite the general
5779+
rule that parentheses can be ignored. This is encoded using the choice of
5780+
<code>cl</code> or <code>cp</code> for the call expression. The
5781+
<code>cp</code> mangling is used only when the callee operand is a parenthesized
5782+
unresolved name and would have used ADL if it were not parenthesized. In
5783+
particular, <code>cl</code> is still used when unqualified lookup finds a
5784+
declaration that would suppress the use of ADL, such as a class member.</p>
5785+
57745786
<a name="mangling.literal">
57755787
<h5><a href="#mangling.literal">5.1.6.1 Literals</a></h5>
57765788

0 commit comments

Comments
 (0)