title: function that return const and core dump
body: <p><strong>Hello everyone</strong></p>
  <p>This is my first question, related to C++ University Course</p>
  <p>I tried playing with the initialization of strings and got the following results, I'd love to know why this is happening ( the results are in comments )</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  const string foo() {}
  int main() {
      const string a = foo();
      string b = foo(); // Will make core dump
      const string&amp; c = foo(); // Will make core dump
      string&amp; d = foo(); // Compile error
      const string&amp; e = &quot;HEY&quot;; // Will make core dump
  }
  </code></pre>
  <p><strong>Thanks!</strong>
  Note: Its not a valid code</p>
  <p>used as an exercise in the University</p>