<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60486>60486</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[C++20] [Modules] Cannot use concept with class template argument deduction in global module fragment
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
davidstone
</td>
</tr>
</table>
<pre>
Given the following valid set of translation units:
```cpp
module;
template<typename = void>
struct s {
};
template<typename>
concept c = requires { s{}; };
export module a;
```
```cpp
module;
template<typename = void>
struct s {
};
template<typename>
concept c = requires { s{}; };
export module b;
import a;
```
And compiling with
```shell
clang++ -std=c++20 -x c++-module a.cpp --precompile -o a.pcm
clang++ -std=c++20 -x c++-module b.cpp --precompile -o b.pcm -fmodule-file=a.pcm
```
Causes clang to fail with
```
b.cpp:8:9: error: redefinition of concept 'c' with different template parameters or requirements
concept c = requires { s{}; };
^
a.cpp:8:9: note: previous definition is here
concept c = requires { s{}; };
^
1 error generated.
```
The practical effect of this bug is that `#include <ranges>` fails when used in two modules with libstdc++.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVc2O4zYMfhr5QjhwpCS2Dz7kp-mpt76ALNG2CllyJTrZfftCdrwz2E47wKCnBkEShuTHv4-0jNH0DrFhxws73jI50-BDo-XD6EjeYdZ6_b351TzQAQ0InbfWP43r4SGt0RCRwHdAQbpoJRnvYHaGIhNnVtxYsX2eivWtpmn9Z_R6tsjE5b0Z4ThZScjElb5P6OSIwMQNHt5oJn5ZjSKFWRFEYOXmXN4-B_rhr7xTOBGoBTrgn7MJuKBBTJALGPwdE79NPhCsiYN80261_b8Lbn_SmnHRftKHs9Og_DgZmzjzNDR82KU4oLWvbK10PeMXxi-QR9JM3NQq8gLyb_AS8m0OOzVNkOdTwDUOQu5B7iY1fgmv_RCvTXiQd6tR3pk0ydu7KB8Wf5VzxAhLBkAeOmnsP_dgFZf4TJwrJs41E2fAEHxIPwJq7Iwzy5L5DraxMl4qxssFGLTpOgzoCDZGwCSDHJEwRPBhG_-IjuJX6QGvFzu-GCZ_Ttr5RMUzTAEfxs8R3qVuIgwY8D8Lvl9bBD06DJJQ7_5lJL8PCFOQioySFrDrUK0HbDAR2rlP2dEgCZIfF8YpO-u0k9cgXY8xLdWpWCYZ4TmggzmiBuOAnv61KnEdhTVtJP2i1y7TjdC1qGWGzf5UHsWJV_U-G5r6ILqqKgq1F6VUpaiLUralKkrJZcfbU2YaXnBR8ILvK3E47ndcqFNR1lWna15VnWaHAkdp7M7ax7jzoc9MjDM2p-JQnTIrW7RxOfCcO3zComScp3sfmuSTt3Mf2aGwJlJ8QyFDdnkyXLd9YccbsOPlt7XMJF2lc55SE37wcSleWRnjGwdl6OdEOdCoZ7XSwEFvfSvtdmC6IPtkk83BNgPRtDxE-J3xe29omNud8iPj95Tf6yufgv8DFTF-X6qKjN-Xqv8KAAD__-z4CPk">