While working with some code I experienced QT Creator performance degradation. Actually it launches a thread that occupies 100% CPU in an infinite loop: even closing the IDE process without killing it becomes impossible. This is fully reproducible on my machine. Before submitting a bug I wish to get a confirmation from other users and to collect some statistics for the versions of QT Creator, OS, compiler, STL, etc. The code requires C++11 and higher.
After some investigation I reduced my code to the shortest sample that reproduces the issue (don't look at the symantics of the code, the problem is in how does the IDE treats it):
#include <set>
int main() {
std::set<int> s;
auto iter = s.insert(1).first;
iter->second;
return 0;
}
The highlights:
- auto is important
- the same behavior can be reproduced with the map instead of the set
- insert is important as it returns not a simple iterator but a pair< iterator, bool>
- The line iter->second is symantically incorrect, but that is not important (you may use std::set< std::pair> to make it correct). The problem is that the IDE crashes after iter-> whatever it could mean.
My configuration is: QT Creator 3.5.1 based on Qt 5.5.1 (MSVC 2013, 32 bit); Windows 10.