I’m setting up Clang module maps for Qt, and hitting an error when trying to use the module from plain C++. Without -fcxx-modules things build fine:
❯ QT_DIR=/Users/torarne/build/qt/6.x && clang++ -c -std=c++17 -fmodules -F$QT_DIR/qtbase/lib -I$QT_DIR/qtbase/lib/QtCore.framework/Headers main.cpp
but -fcxx-modules I get a redefinition error that points to the exact same file and line:
❯ QT_DIR=/Users/torarne/build/qt/6.x && clang++ -c -std=c++17 -fmodules -fcxx-modules -F$QT_DIR/qtbase/lib -I$QT_DIR/qtbase/lib/QtCore.framework/Headers main.cpp
In file included from main.cpp:3:
/Users/torarne/build/qt/6.x/qtbase/lib/QtCore.framework/Headers/qstring.h:64:30: error: redefinition of 'treat_as_integral_arg'
64 | template <typename T> struct treat_as_integral_arg : std::false_type {};
| ^
/Users/torarne/build/qt/6.x/qtbase/lib/QtCore.framework/Headers/qstring.h:64:30: note: previous definition is here
64 | template <typename T> struct treat_as_integral_arg : std::false_type {};
What’s going on here? ![]()