-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.7.1, Qt Creator 4.8.0-beta1
-
None
-
c8c642dde0ab32a25942e970a8a332694f47c10c (qt-creator/qt-creator/4.8)
When selecting a different diagnostic Configuration it is not applied (probably only to the code model).
To test it just create a simple file with
int i = 0;
i = i;
The second line will result in a self-assign error. No create a clang config with "-Wno-self-assign" and activate it. The warning will not be removed.
It looks like the config tool does not update the internal configuration (and the QtCreator.ini) correctly. The selected diagnostic configuration is stored under [ClangTools] at the key diagnosticConfigId. I think this key is used for clang-tidy and clazy calls. But the code model uses the key ClangDiagnosticConfig under [CppTools]. This is not updated, when selecting a different configuration.
I found this bug, because an older version wrote the ClangDiagnosticConfig-Key with a configuration I created. I deleted my own configuration in 4.7.1, but the key was not reset. This lead to a crash in QtCreator, whenever I opened a source file, because the value is used for CppCodeModelSettings::setClangDiagnosticConfigId, which is used to find the index of the configuration in a list of configurations. Since I deleted the configuration it was not available anymore and indexOfConfig in ClangDiagnosticConfigsModel::configWithId returned -1, resulting in an assertion in QVector::at...
For Gerrit Dashboard: QTCREATORBUG-21273 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
244727,2 | ClangTools: Fix using clang options of diagnostic config | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
244959,2 | Clang: Fix crash when removing diagnostic config | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |
244972,2 | Clang: Fix reading inconsistent settings | 4.8 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |