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

Add IWYU pragma to forwarding headers?

XMLWordPrintable

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

      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?

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes