title: Is allocating a dynamic array without specifying size well formed code?
body: <p>The following simple program snippet gives compilation errors with <code>gcc-4.3.4</code>.    </p>
  
  <p><strong>Program:</strong></p>
  
  <pre><code>int main() 
  {   
      char *ptr = new char[10];     
      char *ptr1 = new char[];      
      return 0; 
  }  
  </code></pre>
  
  <p><strong>Compilation errors:</strong></p>
  
  <blockquote>
    <p>prog.cpp: In function ‘int main()’:<br>
    prog.cpp:4: error: expected primary-expression before ‘]’ token<br>
    prog.cpp:3: warning: unused variable ‘ptr’<br>
    prog.cpp:4: warning: unused variable ‘ptr1’       </p>
  </blockquote>
  
  <p>But the same compiles cleanly with MSVC without any diagnostic message.     </p>
  
  <p>So my question is:<br>
  Does the Standard allow an <code>new []</code> to be called without specifying the <code>size</code>? Or this a bug in MSVC?<br>
  Can someone provide a reference from the standard which will conclusively say that the above code example is ill-formed or well-formed?     </p>
  
  <hr>
  
  <p>I have had a look at:     </p>
  
  <p><strong>5.3.4 New [expr.new]</strong> &amp;<br>
  <strong>18.4.1.2 Array forms [lib.new.delete.array]</strong>     </p>
  
  <p>but couldnt find any conclusive evidence about the behavior.</p>
  
  <hr>
  
  <p><strong>EDIT:</strong><br>
  Adding the <code>Language Lawyer</code> tag.<br>
  I am expecting the answer for an observed behavior regardless of whether it is useful or not, I am fully aware it is not useful nor recommended.</p>