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

Override generator adds () after keyword

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • Qt Creator 4.11.0
    • C/C++/Obj-C++ Support
    • None
    • Linux/X11

      OS: Ubuntu 1604

      When overriding a virtual method, the code generator adds () after the override keyword.

      Repro case

      1. Create a base class with a virtual function.
      2. Create a sub class and begin typing the virtual function declaration in the header file.
        • The code completer suggests the function name with the override key word.
      3. Accept the code completer candidate.

      Expected result

      The code completion generates the function declaration with correct signature.

      Actual result

      The code completion generates the function name with correct signature, except with an added () pair at the end of the function declaration.

      For example

      // code placeholder
      class A {
      public:
          A();
          virtual void doSomething();
      };
      
      //I'm using a different header file for class B
      class B : public A {
      public:
          B();
          void doSomething() override(); //OOPS generator added extra parens CLANG error in IDE
      };

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

            kosjar Nikolai Kosjar
            jbarnesweb Jeff Barnes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes