title: Bitshift and integer promotion?
body: <p>Normally, C requires that a binary operator's operands are promoted to the type of the higher-ranking operand. This can be exploited to avoid filling code with verbose casts, for example:</p>
  
  <pre><code>if (x-48U&lt;10) ...
  y = x+0ULL &lt;&lt; 40;
  </code></pre>
  
  <p>etc.</p>
  
  <p>However, I've found that, at least with gcc, this behavior does not work for bitshifts. I.e.</p>
  
  <pre><code>int x = 1;
  unsigned long long y = x &lt;&lt; 32ULL;
  </code></pre>
  
  <p>I would expect the type of the right-hand operand to cause the left-hand operand to be promoted to <code>unsigned long long</code> so that the shift succeeds. But instead, gcc prints a warning:</p>
  
  <pre><code>warning: left shift count &gt;= width of type
  </code></pre>
  
  <p>Is gcc broken, or does the standard make some exception to the type promotion rules for bitshifts?</p>