title: simple user defined class with operator = overloading code crashed
body: <p>I am testing a simple operator overloading code, when testing it, this piece of code just crashes (core dumped) at "nd.print()". Any suggestion?</p>
  
  <p>The crash happens on ubuntu 16.04 64 bit. When I tried on some of online shell environment, such as <a href="https://www.onlinegdb.com/online_c++_compiler" rel="nofollow noreferrer">https://www.onlinegdb.com/online_c++_compiler</a>, it seems ok.</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  class Node
  {
      int d;
      public:
      Node (int dd = 0):d(dd){}
      Node &amp;operator=(Node &amp;nd){ d = nd.d; }
      void print(){ cout&lt;&lt;d&lt;&lt;endl; }
  };
  
  int main()
  {
      Node nd1(1), nd2(2);
      Node nd;
      nd = nd2 = nd1;
      nd.print();    //*******Crash here
      return 0;
  }
  </code></pre>
  
  <p>I expect it just print a value without crashing.</p>