<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - decltype of template parameter object is not const"
   href="https://bugs.llvm.org/show_bug.cgi?id=49609">bug 49609</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>INVALID
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - decltype of template parameter object is not const"
   href="https://bugs.llvm.org/show_bug.cgi?id=49609#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - decltype of template parameter object is not const"
   href="https://bugs.llvm.org/show_bug.cgi?id=49609">bug 49609</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>Clang's behavior is correct. `decltype(V)`, where `V` is an id-expression,
produces the type of the entity denoted by `V`, not the type of the expression.
See [dcl.type.decltype]/1.2:

"if E is an unparenthesized id-expression naming a non-type template-parameter
(13.2), decltype(E) is the type of the template-parameter after performing any
necessary type deduction (9.2.9.6, 9.2.9.7);"

Per [temp.param](13.2)/6, the type of the template parameter is not
const-qualified, even though (per (13.2)/8) the type of the template parameter
object is.

So decltype(V) in this case is 'A', but decltype((V)) is 'const A&'.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>