Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
Qt Creator 15.0.0
-
None
-
-
319a5ccd8 (master)
Description
Qt Creator offers the "Insert Virtual Functions of Base Classes" option when a base type has virtual functions.
However, Qt Creator seemingly fails to parse base types behind a using-declaration in a different namespace. Here's the minimal reproducible code snippet:
namespace A { struct Base { virtual void foo() = 0; }; } // namespace A using A::Base; // typedef A::Base Base; struct Derived : Base {};
Focus the text cursor on the Base after struct Derived :, then Press "Alt + Enter" to open the Refactor menu. The "Insert Virtual Functions" isn't available.
A workaround is to use typedef instead. In the above code snippet, comment out using-declaration and uncomment typedef, then open the Refactor menu, and "Insert Virtual Functions" will be available for use.
However, typedef doesn't work with class templates, using-declaration is required to alias a class template.