title: Still unsure about signed integer overflow in C++
body: <p>In the following code I tested which form of overflow results in UB and causes therefore
  an hard error in a <code>constexpr</code> context:</p>
  <pre><code>#include &lt;cstdint&gt;
  #include &lt;limits&gt;
  
  using T = int8_t;
  int main() {    
      constexpr bool b = []{
          T x = std::numeric_limits&lt;T&gt;::max();
          ++x; // GCC: UB, Clang: no UB
  //        x += 1;
  //        x = x + 1;
          return (x &gt; std::numeric_limits&lt;T&gt;::max());
      }();
  
      return b;    
  }
  </code></pre>
  <p>The preincrement gives an error (as I expected) for gcc but not for clang.</p>
  <p>More strange is that the standard says that <code>++x</code> is the same as <code>x += 1</code>, but using this gives no more an error on gcc (and clang as before).</p>
  <p>And further <code>x += 1</code> should be the same as <code>x = x + 1</code>, so the rhs is promoted to <code>int</code> and the result is implicitly converted. So, this should newer be UB.</p>
  <p>So, the question is, which of the three statement really should be UB (I think only <code>++x</code>) and which compiler is correct?</p>