Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
Qt Creator 4.9.0
-
None
Description
When "if constexpr" contains some function call or a variable as condition and its body contains nested scope, it's not possible to move a function definition outside of the class correctly.
Repro steps:
1) Launch Qt Creator
2) Use the following code snippet:
template <class Bar, class Baz> class Foo { public: void doSmth() { if constexpr (someCondition()) { for (int i = 0; i <10; ++i) { } } } void doSmthElse() { // ... } static constexpr bool someCondition() { return std::is_base_of<int, Bar>{}; } };
3) Move the definition of doSmth() function outside of the class using standard refactoring option
Actual: the last curly brace is not moved (at all)
Expected: the function moved outside correctly