title: Can the multiplication of two unsigned shorts really lead to undefined behaviour?
body: <p>I have spent some time trawling this site; in particular this question: <a href="https://stackoverflow.com/questions/40751662/is-a-b-255-255-the-same-as-a-b-255">Is ((a + (b &amp; 255)) &amp; 255) the same as ((a + b) &amp; 255)?</a></p>
  
  <p>In doing so, I've been led to the conclusion that</p>
  
  <pre><code>int main()
  {
      unsigned short i = std::numeric_limits&lt;unsigned short&gt;::max();
      unsigned short j = i;
      auto y = i * j;
  }
  </code></pre>
  
  <p>can lead to undefined behaviour due to a type promotion of <code>i</code> and <code>j</code> to <code>int</code> which subsequently overflows upon the multiplication! Perhaps <code>i</code> and <code>j</code> need not to even be this large.</p>
  
  <p><strong>My conclusion is that, for example, on a system where <code>unsigned short</code> is 16 bits and <code>int</code> is 32 bits, the behaviour can be <em>undefined</em>.</strong></p>
  
  <p>Am I correct here?</p>