title: Why does this C++ snippet compile (non-void function does not return a value)
body: <p>I found this in one of my libraries this morning:</p>
  
  <pre><code>static tvec4 Min(const tvec4&amp; a, const tvec4&amp; b, tvec4&amp; out)
  {
      tvec3::Min(a,b,out);
      out.w = min(a.w,b.w);
  }
  </code></pre>
  
  <p>I'd expect a compiler error because this method doesn't return anything, and the return type is not <code>void</code>.</p>
  
  <p>The only two things that come to mind are</p>
  
  <ul>
  <li><p>In the only place where this method is called, the return value isn't being used or stored. (This method was supposed to be <code>void</code> - the <code>tvec4</code> return type is a copy-and-paste error)</p></li>
  <li><p>a default constructed <code>tvec4</code> is being created, which seems a bit unlike, oh, everything else in C++.</p></li>
  </ul>
  
  <p>I haven't found the part of the C++ spec that addresses this. References (ha) are appreciated.</p>
  
  <p><strong>Update</strong></p>
  
  <p>In <em>some</em> circumstances, this generates an error in VS2012. I haven't narrowed down specifics, but it's interesting, nonetheless.</p>