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

    <tr>
        <th>Summary</th>
        <td>
            Clang incorrectly complains about default argument not being reachable 
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          ilya-biryukov
      </td>
    </tr>
</table>

<pre>
    Run a compiler on this code:
```cpp
// --- foo.cppm
export module foo;

export struct partial {};
export template <class T, class Cat = partial> concept is_comparable = true;

// --- bar.cppm
export module bar;

import foo;
template <class T>
void func() requires is_comparable<T> {}
```

The exact commands are:
```sh
$ clang++ -std=c++20 --precompile foo.cppm
$ clang++ -std=c++20 --precompile bar.cppm -fmodule-file=foo.pcm
```

Expected results: code compiles with no errors.
Actual: Clang produces the following error when compiling the module `bar`:
```sh
bar.cppm:6:22: error: default argument of 'is_comparable' must be imported from module 'foo' before it is required
void func() requires is_comparable<T> {}
 ^
foo.cppm:5:39: note: default argument declared here is not reachable
export template <class T, class Cat = partial> concept is_comparable = true;
                                      ^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8VN2OszYQfRpzMyIiNj_LBRck2TxA9d1XxgzBrcHUHu_P21cOJN1Nd6tWlb4oUojn75w5B0vv9WVGbFhxYMUpkYFG6xpt3mXaafcefrcvSWf79-aXMIMEZadFG3RgZ6BRe1C2RyZalp1Y1rIyW79qWbYTfmb8DGmawmDtTi3LtAbwbbGOYLJ9MBhjTBy2ko9xTy4ogkU60tIAqw6sOt1TtyTCaTGSEJg4KiO9hx-MH2F9PEoCJk63Fkw8g7KzwoVA-18jH-lkZ_CaRC7gA5APDDrpvmXQSfdQqKdr_CO1r4CK5zX2YnUPQ5gV40-M1-Dwj6Ad-s8omTjGktsiPm_94_QfIwK-SUVRsknOvQfpvlDKjzeaeVzYfGH8wPgBUk89Eye1_uUZpOnicJP_Qcv_VnvbIqTDurt00JHYKTZd1PQPpJ7fFlSEPTj0wZBnor0a8GZLD6-aRpgtoHPW-d1a1ioKUfkWjhElLM72QaEHGiMVY-yrni9rDbyOOG_94mFM2SRmZRZVLrPvt3h3iGhLJlrO49Br3_jQ4yCDIZDuEiacCewAjFefBeYVTMETdAirg7CHwdnpjoJX0VK8gg4H6xB0NPLNLv3_NROwYjPkXWPRFky0oo4UZkv4JZUelZEOexgxYvIxExxKNV4n_YTXFf7V505vv-l9wRmdJOx3D5omfSP6WtQywWZf1nnJi7wqkrHhKp4KKapciK7Cff30tBeYDSIb6gHzRDc84yKr92Jf7aui2BVFVw5lzVWei3Jf1CzPcJLa7Ix5mXbWXRLtfcCmLHlRJEZ2aPztRnZNTEq7cPEsz4z25P8qI00Gm9XVelbWOVRk3q_-NVLPHmRnA_1drqhOh9Hgd40gCc40I9ES36v12rtoGkO3U3Zi_Bynbj_p4uxvqIjx8xW5Z_x8Bf9nAAAA___-pPFh">