title: c++ - error :invalid initialization of reference of type 'const testGetter*&' from expression of type 'testGetter* const'
body: <p>I know it has come up a zillion times but this time it was autogenerated code :</p>
  
  <pre><code>class testGetter{
      testGetter * ptr; // wrote this
  public:
  // this is autogenerated by eclipse
      const testGetter*&amp; getPtr() const {
          return ptr;
      }
  
      void setPtr(const testGetter*&amp; ptr) {
          this-&gt;ptr = ptr;
      }
  };
  </code></pre>
  
  <p>I am on windows 7 mingw - g++ version <strong><em>4.7.0</em></strong></p>
  
  <p>So is it a bug in the templates of eclipse (juno) ?</p>
  
  <p>EDIT : compiler invocation :</p>
  
  <pre><code>g++ -O0 -g3 -Wall -c -fmessage-length=0 -fpermissive -o Visitor.o "..\\Visitor.cpp"
  </code></pre>
  
  <p><strong>EDIT 2013.06.12</strong> : I should have added that <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=393297" rel="nofollow">I reported the thing</a> after the feedback I got here</p>