title: Why is returning address of local variable or temporary only a warning and not an error?
body: <p>Having just received a warning from the compiler for this function:</p>
  
  <pre><code>template&lt;class T&gt;
  Matrix3x3&lt;T&gt; &amp; operator - (Matrix3x3&lt;T&gt; const &amp; p)
  {
      auto m = Matrix3x3&lt;T&gt;(p);
  
      m.m11 = -m.m11; m.m12 = -m.m12; m.m13 = -m.m13;
      m.m21 = -m.m21; m.m22 = -m.m22; m.m23 = -m.m23;
      m.m31 = -m.m31; m.m32 = -m.m32; m.m33 = -m.m33;
  
      return m;
  }
  </code></pre>
  
  <p>, I am wondering why returning an address of local variable or temporary doesn't merit an error.  Are there circumstances where you have to do it?  What's the rationale for this only being "undefined behaviour" and not a language constraint?</p>
  
  <p>I can't think of any.  </p>