<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58573>58573</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            error: 'llvm::operator-' has different definitions in different modules
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          cjdb
      </td>
    </tr>
</table>

<pre>
    ## Details

**LLVM hash**: 00c2eb214d6948b7ac53dc024e8c4c375887d262
**OS**: Ubuntu 20.04.5 (GitHub Actions job)
**Build toolchain**: LLVM nightly

## Config step

```cmake
$ export CC=/usr/bin/clang-16 CXX=/usr/bin/clang++-16
$ cmake
  -G Ninja
  -S llvm-project/llvm
  -B build
  -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_CROSSCOMPILING=Yes
  -DCMAKE_INSTALL_PREFIX=/tmp/llvm
  -DLLVM_DEFAULT_TARGET_TRIPLE=${{ matrix.target.triple }}
  -DLLVM_ENABLE_LLD=Yes
  -DLLVM_ENABLE_LIBCXX=Yes
  -DLLVM_ENABLE_MODULES=Yes
  -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld;polly'
  -DLLVM_ENABLE_RUNTIMES='compiler-rt;libcxx;libcxxabi;libunwind'
  -DLLVM_ENABLE_ZLIB=Yes
  -DLLVM_TARGETS_TO_BUILD=${{ matrix.target.name }}
```
where `${{ matrix.target.triple }}` can be `x86_64-unknown-linux-gnu` or `armv7a-unknown-linux-gnu`, and `${{ matrix.target.name }}` respectively is X86 or ARM.

## Diagnostic

```
/usr/bin/clang++-16 -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/runner/work/lah-toolchain/lah-toolchain/build/lib/Support -I/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support -I/home/runner/work/lah-toolchain/lah-toolchain/build/include -I/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -fmodules -fmodules-cache-path=/home/runner/work/lah-toolchain/lah-toolchain/build/module.cache -Xclang -fmodules-local-submodule-visibility -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections  -O3 -DNDEBUG -std=c++17  -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/APInt.cpp.o -c /home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support/APInt.cpp
In module 'LLVM_Utils' imported from /home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support/APInt.cpp:14:
/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include/llvm/Support/TypeSize.h:214:10: error: 'llvm::operator-' has different definitions in different modules; definition in module 'LLVM_Utils.Support.TypeSize' first difference is return type is 'std::enable_if_t<std::is_signed<U>::value, LeafTy>' (aka 'typename enable_if<std::is_signed<U>::value, type-parameter-0-0>::type')
  friend std::enable_if_t<std::is_signed<U>::value, LeafTy>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include/llvm/Support/TypeSize.h:96:10: note: but in 'LLVM_Utils.Support.TypeSize' found different return type 'typename std::enable_if_t<std::is_signed<U>::value, LeafTy>' (aka 'typename enable_if<std::is_signed<U>::value, type-parameter-0-0>::type')
  friend typename std::enable_if_t<std::is_signed<U>::value, LeafTy>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[11/4440] Building CXX object lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o
FAILED: lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o 
/usr/bin/clang++-16 -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/runner/work/lah-toolchain/lah-toolchain/build/lib/Support -I/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support -I/home/runner/work/lah-toolchain/lah-toolchain/build/include -I/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -fmodules -fmodules-cache-path=/home/runner/work/lah-toolchain/lah-toolchain/build/module.cache -Xclang -fmodules-local-submodule-visibility -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections  -O3 -DNDEBUG -std=c++17  -fno-exceptions -fno-rtti -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/APFloat.cpp.o -c /home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support/APFloat.cpp
In module 'LLVM_Utils' imported from /home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/lib/Support/APFloat.cpp:14:
/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include/llvm/Support/TypeSize.h:214:10: error: 'llvm::operator-' has different definitions in different modules; definition in module 'LLVM_Utils.Support.TypeSize' first difference is return type is 'std::enable_if_t<std::is_signed<U>::value, LeafTy>' (aka 'typename enable_if<std::is_signed<U>::value, type-parameter-0-0>::type')
  friend std::enable_if_t<std::is_signed<U>::value, LeafTy>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/runner/work/lah-toolchain/lah-toolchain/llvm-project/llvm/include/llvm/Support/TypeSize.h:96:10: note: but in 'LLVM_Utils.Support.TypeSize' found different return type 'typename std::enable_if_t<std::is_signed<U>::value, LeafTy>' (aka 'typename enable_if<std::is_signed<U>::value, type-parameter-0-0>::type')
  friend typename std::enable_if_t<std::is_signed<U>::value, LeafTy>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[12/44[40](https://github.com/cjdb/lah-toolchain/actions/runs/3306277377/jobs/5457045424#step:7:41)] Building CXX object lib/Demangle/CMakeFiles/LLVMDemangle.dir/ItaniumDemangle.cpp.o
ninja: build stopped: subcommand failed.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztGdt24jjya8yLjjnGNpg88GAwZNiFkMNlu2defGRbgNJC8lpyLvP1W2VzSw-d6Z50z_buIcexrVKpVHdV4URlLz3L9eAiETOUC205keWE-7uL12TyrynZUr2th5YXEsdJXZa4LT_r3PjdJKBp28tSx_VZN_VTL2h3u0HmdtxzMrPFaf0qKaUpies0Hb_ZJpbbveXmlzIhYWq4kpo8qMRyb86X90suMmKUEumWcnmiVbEn-WZrxMtr5iuxBkqu-YZow_JXsx2nvtId_cQOK3zCnnNVG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