Details
-
Bug
-
Resolution: Cannot Reproduce
-
Not Evaluated
-
None
-
Qt Creator 4.11.0
-
None
-
Arch Linux
Qt 5.14.0
Description
Suppose you have a class in myclass.h
class MyClass() { public: MyClass(); void existing(); void notExistingYet(); };
and the associated myclass.cpp is
#include "myclass.h" struct blah { int a; int b; int c; }; MyClass::MyClass() {} void MyClass::existing() { struct blah my_blah{ 1, 2, 3 }; do_something_with(my_blah); }
and you decide to implement notExistingYet() hitting Refactor -> Add definition in *.cpp.
Then myclass.cpp becomes:
#include "myclass.h" struct blah { int a; int b; int c; }; MyClass::MyClass() {} void MyClass::existing() { struct blah my_blah{ 1, 2, 3 } void MyClass::notExistingYet() { }; do_something_with(my_blah); }
i.e. it misses the initialization opening brace and takes the initialization closing brace as the method ending brace, putting the new method inside the old one.