Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-6221

Add Definition doesn't understand r-value references

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • Qt Creator 2.3.0
    • C/C++/Obj-C++ Support
    • None
    • Arch Linux, KDE desktop environmant

    Description

      When you declare a move constructor in .h and you use Add Definition option, a definition that is added in the .cpp file contains a l-value reference type in the constructor's parameter list, instead of the r-value reference type.

      Example:
      If we this declaration in the simple.h file:

      class Simple
      {
      public:
      	Simple();
      	Simple(Simple &&simple);
      	void SetName(QString &&newName);
      	Simple& operator =(Simple &&simple);
      
      private:
      	QString *m_name;
      };
      

      and we use Add Definition option on the Simple(Simple &&simple) in the simple.cpp we will get this:

      Simple::Simple(Simple &simple)
      {
      }
      

      instead we need to get:

      Simple::Simple(Simple &&simple)
      {
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              erikv Erik Verbruggen
              pivonroll Radovan Zivkovic
              Votes:
              3 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes