Re: [cxx-abi-dev] mangling template-id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cxx-abi-dev] mangling template-id



On 12/17/2009 07:09 PM, Jason Merrill wrote:
On 12/17/2009 05:58 PM, Jason Merrill wrote:
Handling this just as unqualified-name template-args seems to work fine;
any reason not to just add that to expression? We also need to support a
plain identifier for overloaded functions.

Hmm...where this runs into trouble is with operator names. Where t is a
function parameter, operator+(t,t) would mangle as clplfp_fp_E, which is
ambiguous; it could also mean (t+t)().

So I guess we need something to distinguish an operator name used as a
function name from an operator name used as an operator.

New patch adds "on" (operator name) before an operator name used as an unqualified name. It isn't necessary in . and -> expressions, since we already know that the second operand is a name.
*** abi.html.~1~	2009-09-23 16:05:02.162720132 -0400
--- abi.html	2009-12-22 00:16:16.448078822 -0500
*************** from other arguments.
*** 4391,4397 ****
    &lt;expression&gt; ::= &lt;<i>unary</i> operator-name&gt; &lt;expression&gt;
  	       ::= &lt;<i>binary</i> operator-name&gt; &lt;expression&gt; &lt;expression&gt;
  	       ::= &lt;<i>trinary</i> operator-name&gt; &lt;expression&gt; &lt;expression&gt; &lt;expression&gt;
!                ::= cl &lt;expression&gt;* E	        # call
                 ::= cv &lt;type&gt; expression           # conversion with one argument
                 ::= cv &lt;type&gt; _ &lt;expression&gt;* E # conversion with a different number of arguments
                 ::= st &lt;type&gt;		        # sizeof (a type)
--- 4392,4398 ----
    &lt;expression&gt; ::= &lt;<i>unary</i> operator-name&gt; &lt;expression&gt;
  	       ::= &lt;<i>binary</i> operator-name&gt; &lt;expression&gt; &lt;expression&gt;
  	       ::= &lt;<i>trinary</i> operator-name&gt; &lt;expression&gt; &lt;expression&gt; &lt;expression&gt;
!                ::= cl &lt;expression&gt;+ E	        # call
                 ::= cv &lt;type&gt; expression           # conversion with one argument
                 ::= cv &lt;type&gt; _ &lt;expression&gt;* E # conversion with a different number of arguments
                 ::= st &lt;type&gt;		        # sizeof (a type)
*************** from other arguments.
*** 4400,4405 ****
--- 4401,4414 ----
                 ::= &lt;function-param&gt;
                 ::= sr &lt;type&gt; &lt;unqualified-name&gt;                   # dependent name
                 ::= sr &lt;type&gt; &lt;unqualified-name&gt; &lt;template-args&gt;   # dependent template-id
+                ::= dt &lt;expression&gt; &lt;unqualified-name&gt;             # expr.name
+                ::= dt &lt;expression&gt; &lt;unqualified-name&gt; &lt;template-args&gt;
+                ::= pt &lt;expression&gt; &lt;unqualified-name&gt;             # expr->name
+                ::= pt &lt;expression&gt; &lt;unqualified-name&gt; &lt;template-args&gt;
+                ::= on &lt;operator-name&gt;                             # dependent operator-function-id
+                ::= on &lt;operator-name&gt; &lt;template-args&gt;             # dependent operator template-id
+                ::= &lt;source-name&gt;                                  # dependent name
+                ::= &lt;source-name&gt; &lt;template-args&gt;                  # dependent template-id
                 ::= sZ &lt;template-param&gt;                            # size of a parameter pack
  	       ::= &lt;expr-primary&gt;