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

moc: add support for C++20 modules

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.x
    • Fix Version/s: None
    • Component/s: Build tools: moc
    • Labels:
      None
    • Platform/s:
      All

      Description

      C++20 is now approved,
      There's Visual Studio C++ module support,
      Also for Clang,
      And there's GCC modules branch

      Maybe it's time to talk about supporting that features in Qt tools?

      If I understand correctly, moc has to detect that "header" it scanned is actually a module interface unit (it has export module Foo;), and so it has to generate respective moc_Foo.cpp that will be one of the module implementation units, that:

      • starts with module;,
      • has all neccessarry-for-black-moc-magic includes in global module fragment,
      • module Foo; to note that it's module implementation unit for that module Foo it found Q_OBJECT in earlier,
      • Then all that moc-generated magic code (except for #include's as they can be only in global fragment?).

      This issue does not imply that Qt has to ship it's code in C++20 modules, it's simply that moc support will allow users of Qt to use Qt classes within user-defined modules.

        Attachments

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

          Activity

            People

            Assignee:
            fabiankosmale Fabian Kosmale
            Reporter:
            talkless Vincas Dargis
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes