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

clang-tidy with qbs analyzes file in the wrong context

XMLWordPrintable

    • Linux/X11, macOS
    • 1d2af6b4cc5e67498a2c26645186eb3ea7e45093 (qt-creator/qt-creator/master)

      Open Qbs project in QtCreator, set options to "project.withExamples" and run clang-tidy on qbs/examples/collidingmice/mouse.cpp.
      Expected result - clang-tidy works=)
      Actual result - tons of warnings regarding missing Qt files:
      qbs/examples/collidingmice/mouse.h:54:10: error: 'QGraphicsItem' file not found [clang-diagnostic-error]

      Code model shows a lot of errors too, but it is possible to select the correct context from the menu. It appears, that clang-tidy and code model both use "Examples as resources" context instead of the "CollidingMice" context.

      Update: Linux behaves a bit different, when ananlyzing a single file mouse.cpp, clang-tidy works, but when I run clang-tidy for the whole project, I get same errors for this file

      Ticket for kandeler

        For Gerrit Dashboard: QTCREATORBUG-23394
        # Subject Branch Project Status CR V

            kandeler Christian Kandeler
            arch Ivan Komissarov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes