Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 3.4.0
-
Built-in code model
-
4b5315bd7cac5fa9ae48244e559d4ee5edd08612
Description
- Open a C++-file with the following lines:
QString *s = new QString(); s->length();
This is valid C++.
- Right-click on the declaration of s and select "Refactor" -> "Convert to Stack Variable" from the context menu.
The code will be changed to:QString s = ; s.length();
This is invalid code.
The code should remain valid. It could be change to this instead:
QString s; s.length();
It's strange that this works correctly when s is declared as auto s instead of QString *s.
Attachments
Issue Links
- resulted from
-
QTCREATORBUG-13605 "Convert to Pointer" generates invalid code when used on auto variable
- Closed
For Gerrit Dashboard: QTCREATORBUG-14279 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
110803,2 | CppEditor: fix "Convert to Stack Variable" for empty initializer lists | master | qt-creator/qt-creator | Status: MERGED | +2 | 0 |