<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/143788>143788</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Possibly wrong reachability analysis with global module fragments in module partitions
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
rohanlean
</td>
</tr>
</table>
<pre>
The following C++23 code is rejected by clang version 20.1.6, saying that the declaration of `S` is unreachable in `I.cpp`.
```
// H.hpp
struct S{};
// M.cppm
export module M;
// P.cppm
module;
#include "H.hpp"
module M:P;
using T = S;
// I.cpp
module M;
import :P;
T f() { return {}; }
```
A variation involving no module partitions is accepted, and I do not find a reason for the rejection in the standard. My reading of 10.4 and 10.7 is that the definition is reachable, with emphasis on 10.4.3.1 and 10.7.3.2.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxkk82OqzgQhZ_GbErXMoZAWLBIbhRNL1pqqfsFClyAR8ZGtkkmbz8y-ZmevlIkS6njz3XqFBiCHi1Ry3ZHtjtluMbJ-da7Ca0htFnn1K39mggGZ4y7ajvCbyaPTB5lAb1TBDqAp7-pj6Sgu0Fv0I5wIR-0syAFz3nF5G8IeEuX44QR4kSgqDfoMSaVG4BV4pNVItFW6wn7CTtDoG2qvPF-WVglOBMHVonHTxyYPDN5hr_4tCxMHEL0ax_hk9VHVp9YcUySl-o9QWYmDvTP4nyE2anVELz_1H08dXfBoywLbXuzKgIm5f1BKV-iRDl8vEhrSFa_gBUn-PzJv5v5fjPV9bw19T_MFwxM7plsgNVH8BRXb-FlDtLxYx7icIALen0fq7YXZy6pFeuedhf0UadqSKPGvqclkkoBoVXwBsqBdREGbRUgeMLgLAzOb5ndc76jtz9CRKvQKw7wfktqlV5zA-SClxsxF7xOL33LfdBW3yFpcx5Jpw6uOk5A8zJh0AGc3Si84PmLxAsueabaQjVFgxm1eV02VV3vRJFNbVnkqql2kuSuL0kI0ZTYlJ3AoSmoqWSmWynkTlR5LvMiLwuuyqrCEvt9I_d53TWsFDSjNtyYy8ydHzMdwkptXhb1fp8Z7MiE7VuR0tIVtmpahN0p82269Ktbx8BKYXSI4T9M1NFQ--FC0J25wdU7Oz7Na6PjDdCiuSXf2xRG4zo0z9AGj-NMNoY09z-CzFZv2inGJbDisWSjjtPa8d7NTJ5TE4_j1-JdipDJ89Z6YPL88HZp5b8BAAD__9ZeQo8">