Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 6.0.1, Qt Creator 6.0.2, Qt Creator 7.0.0
-
None
Description
struct Base { virtual auto func() && noexcept -> void = 0; }; struct Derived : public Base { auto func() && noexcept -> void override {} };
I tried "Refactor > Move Definition Outside Class" menu for Derived::func() and here's the result:
struct Base { virtual auto func() && noexcept -> void = 0; }; struct Derived : public Base { auto func() && noexcept -> void; }; void Derived::func() &&noexcept override {}
You can see two problems here:
- override keyword should not appear in function definition outside class. This is syntax error. Same problem occurs with final keyword.
- trailing return type function declaration is converted to pre-C++11 style. This is espacially annoying because I have to rewrite every defintion one by one.
One more thing, you may noticed that the space after reference specifier && is removed in function definition outside class. Eventhough this is a formatting issue and can be fixed by re-formatting, it would be nice to keep original format.