title: C++ decltype and parentheses - why?
body: <p>The subject was <a href="https://stackoverflow.com/questions/3097779/decltype-and-parentheses/3097803">discussed</a> <a href="https://stackoverflow.com/questions/14115744/significance-of-parentheses-in-decltypec">before</a>, but this is not a duplicate.</p>
  
  <p>When someone asks about the difference between <code>decltype(a)</code> and <code>decltype((a))</code>, the usual answer is - <code>a</code> is a variable, <code>(a)</code> is an expression.  I find this answer unsatisfying.</p>
  
  <p>First, <code>a</code> is an expression as well. The options for a <a href="https://eel.is/c++draft/expr.prim" rel="noreferrer">primary expression</a> include, among others -</p>
  
  <ul>
  <li>( expression )</li>
  <li><strong>id-expression</strong></li>
  </ul>
  
  <p>More importantly, the phrasing for decltype <a href="https://eel.is/c++draft/dcl.type.decltype" rel="noreferrer">considers parentheses very, very explicitly</a>:</p>
  
  <pre><code>For an expression e, the type denoted by decltype(e) is defined as follows:
  (1.1)  if e is an unparenthesized id-expression naming a structured binding, ...
  (1.2)  otherwise, if e is an unparenthesized id-expression naming a non-type template-parameter, ...
  (1.3)  otherwise, if e is an unparenthesized id-expression or an unparenthesized class member access, ...
  (1.4)  otherwise, ...
  </code></pre>
  
  <p>So the question remains. <em>Why</em> are parentheses treated differently?  Is anyone familiar with technical papers or committee discussions behind it? The explicit consideration for parentheses leads to think this is not an oversight, so there must be a technical reason I'm missing.</p>