title: Non-const reference bound to temporary, Visual Studio bug?
body: <p>I ran into this while compiling some portable code in <code>gcc</code>. Basically this strange code compiles in Visual studio which really just blows my mind:</p>
  
  <pre><code>class Zebra {int x;};
  Zebra goo() {Zebra z; return z;}
  void foo(Zebra &amp;x)
  {
      Zebra y;
      x = y;
      foo(goo());
  }
  </code></pre>
  
  <p><code>Visual studio</code> lets this one fly. <code>gcc</code> will catch this as a compile error.  Interestingly, If you typedef Zebra to int, <code>VC++</code> will complain.  Quite contradictory behavior.  Thoughts?</p>