Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-119505

Add IWYU pragma to forwarding headers?

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P3: Somewhat important
    • None
    • 6.6
    • Build System
    • None
    • 81b15adba (dev)

    Description

      From LLVM 17 on, the clang-tidy tool comes with a "misc-include-cleaner" check which, among other things, checks for missing header files. Unfortunately, it triggers in basically every Qt application, because the canonical headers do not provide the corresponding symbols directly.
      As far as I understand, this could be fixed by annotating the header; e.g. for QString:

      #include "qstring.h" // IWYU pragma: export
      

      While I'm not generally a fan of amending code purely to make tools happy, the cost/benefit ratio seems pretty good in this case.
      Opinions?

      Attachments

        Issue Links

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

          Activity

            People

              qtbuildsystem Qt Build System Team
              kandeler Christian Kandeler
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes