<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/140209>140209</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clangd] Cannot build the module if it's declared in a file with `.ixx` extension
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
SidneyCogdill
</td>
</tr>
</table>
<pre>
Like another [bug](https://github.com/llvm/llvm-project/issues/139189), this bug is discovered when working with C++ module support for the ["Proxy"](https://github.com/microsoft/proxy) library.
I've created a [tiny project](https://github.com/SidneyCogdill/clangd_modules_bug_showcase/tree/clangd_ixx_bug) to demonstrate the bug. Pull the project using the following command:
```sh
git clone \
--single-branch \
--branch clangd_ixx_bug \
--recursive \
https://github.com/SidneyCogdill/clangd_modules_bug_showcase.git
```
(Note: It's a good security practice to audit the project before opening it in your editor)
The module file `proxy.ixx` exposes the interfaces in global fragment. It cannot be built by clangd when the module file ends with `.ixx` file extension. Renaming it to `proxy.cpp` or `proxy.cppm` fixes the issue.
This bug only affects clangd. Clang can build the module without any issue.
clangd version:
```
~> clangd-21 --version
Ubuntu clangd version 21.0.0 (++20250501084208+9b1051281e43-1~exp1~20250501084221.26)
Features: linux+grpc
Platform: x86_64-pc-linux-gnu
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVU2PozgQ_TXOpQQyhhA4cEhnNtJIq9VoP84tYwrwjrGRPxJy6d--MiTTnd7DHHalSJbLlar3np8L7pwcNGJD9i9k_2XHgx-Nbf6QncbbyQydVGrXmu7W_Cq_I3Bt_IgWyP6lDQPZfyGsGr2fHcmPhJ0JOw_Sj6FNhZkIOyt1eSzJbM3fKDxhZ-lcQEfYOcvrrKoJqwk7gR-lgzYMIB100glzQYsdXEfUcDX2u9QDXKUf4UTYC2EvMJkuKAQX5tlYD72x4EeM0Ahj36xZboSxn0KcpLDGmT4Cm7c_1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