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

    <tr>
        <th>Summary</th>
        <td>
            `clang-tidy` fails on CXX modules
        </td>
    </tr>

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

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

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

<pre>
    I don't know where the issue is coming from, so I am posting it here too. There is an equivalent [discourse on cmake](https://discourse.cmake.org/t/clang-tidy-cxx-modules/7938).

Error:
```
error: unable to handle compilation, expected exactly one compiler job in '' [clang-diagnostic-error]
warning: /clang-tidy-issue/test_module.ixx: 'linker' input unused [clang-diagnostic-unused-command-line-argument]
Found compiler error(s).
```

MWE:
```cmake
# CMakeLists.txt
cmake_minimum_required(VERSION 3.26)
project(clang-tidy-issue
                LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_EXPERIMENTAL_CXX_MODULE_CMAKE_API 2182bf5c-ef0d-489a-91da-49dbc3090d2a)
set(CMAKE_EXPERIMENTAL_CXX_MODULE_DYNDEP TRUE)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPERIMENTAL_CXX_MODULE_MAP_FORMAT clang)
set(CMAKE_CXX_CLANG_TIDY "clang-tidy;-checks=*")

add_library(test_library)
target_sources(test_library PUBLIC
                FILE_SET cxx_modules
                TYPE CXX_MODULES
                FILES
                test_module.ixx
                )
```
```cpp
// test_module.ixx
module;

#include <string>

export module test_module;

export namespace test_module {
        consteval std::string_view version(){
                return "0.0.0";
        }
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVUtv6jgU_jVmc5TIdQgkCxYpJFdogKJCZ7iryNgGfJvYjO209N-PnFAevZ3FlZCJ7e-8Pp8HtVbulRAjFD-ieNKjjTtoM5oJZqR9Wfe2mn-Mps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