Issue 158249
Summary Redfinition error with -fcxx-modules
Labels new issue
Assignees
Reporter torarnv
    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 with `-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? :thinking:
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to