Important: Please read the Qt Code of Conduct -

QtCreator - Clang Code Model Version

  • Hello there,
    Is there a way to know which clang version within QtCreator is compiling the code?

    When compiling with clang there are usually the macros clang, clang_major, clang_minor and clang_patchlevel.

    But when compiling withing QtCreator using the Clang Code Model for showing the Annotations, then those macros aren't defined.
    I'm using the Q_CREATOR_RUN macro instead of clang as commented here, but is this reliable enough on the long term?
    What if in the future QtCreator will user another code model instead of clang while still defining the Q_CREATOR_RUN macro?
    And which version has the clang code model version used by the QtCreator Clang plugin?

    About the use case, think about a library maintainer that needs to deactivate certain warnings within specific code sections, especially macros that are then used by the client application of the library showing unwanted Annotations.

    Thank you,