Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
Qt Creator 4.1.0
-
None
-
Linux x86_64 (Arch Linux)
Description
I have encountered a crash with the following code:
container.h
#include <vector> std::vector<int> vec; void myfunc() some_text { for (int element : vec) { } }
The function definition is incorrect and causes the line for (int element : vec) { to be underlined in yellow, which is expected. However, if I right-click this line, QtCreator crashes.
Steps to reproduce :
- Create a new project: "Plain C++ Application", with qmake build system (I've had the issue with CMake as well so I don't think it matters)
- Create a new class with any name
- Remove the class declaration code in the class header file, and replace it with the code above
- Right-click on the for line.
The function isn't declared nor defined anywhere else.
The crash doesn't happen if I remove the for's braces.
The crash only happens in header files that have been created using "New C++ Class".
I have included a stack trace.
Feel free to ask for details if needed.
Attachments
Issue Links
- is duplicated by
-
QTCREATORBUG-14615 Crashes when opening a c++ file
- Closed
For Gerrit Dashboard: QTCREATORBUG-17253 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
176683,2 | CppEditor: Fix null pointer access | 4.2 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |