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

"Extract Function" refactoring may cause compile error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • Qt Creator 2.5.0-rc
    • C/C++/Obj-C++ Support
    • None

      1. Create a new Qt Gui Application.
      2. Open main.cpp from this project.
      3. Select line 8:
            w.show();
        
      4. Press Alt+Enter.
      5. Press Enter to trigger "Extract Function".
      6. Enter a name for the function and press Enter again.
        Creator will add a function with one parameter of type MainWindow. This can't be compiled since MainWindow's copy ctor is not public.

      Refactor actions should never make correct code incorrect. In this case a const reference might be used.

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

            erikv Erik Verbruggen
            rlohning Robert Löhning
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes