Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-21273

Clang diagnostic configuration not applied / Creator crash

XMLWordPrintable

    • 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...

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            kosjar Nikolai Kosjar
            jvehlow jvehlow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes