[clang] [C++20] [Modules] Introduce -fgen-reduced-bmi (PR #85050)

Paul Schwabauer via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 15 13:23:45 PDT 2024


koplas wrote:

Using `-fgen-reduced-bmi` currently fails for me with a case that looks like this:
```C++
// a.hpp
  template <typename T>
  void ignore(T const &) noexcept {}
  
  inline void resultCheck(char const *message) {
      ignore(message);
  }
  
// b.cppm
    module;
    #include "a.hpp"
    export module b;
    
    export {
        using ignore;
        using resultCheck;
    }
    
// c.cppm
    export module c;
    import b;
    
    export void test() {
        resultCheck(nullptr);
    }
```
This will result in this linker error: `undefined reference to void ignore<char const*>(char const* const&)`.
Removing `-fgen-reduced-bmi` will result in linking without errors. Do I need to pass certain flags to CMake?

https://github.com/llvm/llvm-project/pull/85050


More information about the cfe-commits mailing list