title: G++ flags to disable "temporary to non-const reference" error
body: <p>I am looking for some command-line flags (should they exist) that disable the GCC error for this type of C++ code:</p>
  
  <pre><code>#include &lt;string&gt;
  
  void m(std::string&amp; s) { }
  
  int main()
  {
          m(std::string(""));
  }
  </code></pre>
  
  <p>G++ gives this error:</p>
  
  <blockquote>
    <p>error: invalid initialization of non-const reference of type 'std::string&amp;' from a temporary of type 'std::string'</p>
  </blockquote>
  
  <p>The reason is to be able to quickly migrate from VC++ and Sun Studio (without any code changes), since both silently accept temporary to non-const lvalue ref conversions. I know what needs to be done in terms of code changes -- I am strictly asking about a way to do it <strong>without making code changes</strong>.</p>
  
  <p>I will be using GCC 4.x.</p>