title: Is the comma operator allowed in a constant-expression in C++11?
body: <p>In the process of answering <a href="https://stackoverflow.com/questions/16563114/are-these-null-pointers-or-are-they-pointers-to-address-0/16564608?noredirect=1#comment23807331_16564608">this question on SO</a> for C++11, I realized that in C++03 (as well as in C) the use of the comma operator is explicitly forbidden in a <em>constant-expression</em>.</p>
  
  <p>Paragraph 5.19/1 of the C++03 Standard on constant expressions says:</p>
  
  <blockquote>
    <p>[...] In particular, except in sizeof expressions, functions, class objects, pointers, or
    references shall not be used, and assignment, increment, decrement, function-call, or <strong>comma operators shall
    not be used</strong>.</p>
  </blockquote>
  
  <p>In C++11, however, that last part mentioning the comma operator seems to be vanished. And while paragraph 5.19/2 of the C++11 Standard clearly specifies that assignment, increment, decrement, and non-<code>constexpr</code> function call expressions shall not appear as sub-expressions of a <em>constant-expression</em>, the usage of the comma operator does not seem to be forbidden anymore.</p>
  
  <p>For instance, the following program compiles fine on GCC 4.7.2 and Clang 3.3 with <code>std=c++11</code> (apart from compiler warnings saying the comma operator has no effect and the <code>x</code> and <code>arr</code> variables are unused):</p>
  
  <pre><code>int main()
  {
      constexpr int x = (0, 42);
      int arr[(0, 42)];
  }
  </code></pre>
  
  <p>However, it must be said that even the following program compiles fine with the <code>-std=c++03</code> option (both on Clang and GCC), which is clearly <em>not</em> correct, given the above quote from the C++03 Standard:</p>
  
  <pre><code>int main()
  {
      int arr[(0, 42)];
  }
  </code></pre>
  
  <p><strong>QUESTION:</strong></p>
  
  <p>Is there a difference between C++03 and C++11 as to whether or not the comma operator is allowed in a constant expression, or am I missing something?</p>
  
  <p>As a bonus (non-constructive) question, I would be interested in knowing why the comma operator cannot be used in a constant expression in C++03. </p>