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

    <tr>
        <th>Summary</th>
        <td>
            [Clang][Regression:20][Modules] Name lookup failed to find hidden friend in non-exported base class
        </td>
    </tr>

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

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

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

<pre>
    m.cppm
```c++
export module m;
struct Base {
    template <class T>
    friend constexpr auto f(T) { return 0; }
};
export struct A: Base {};
```

main.cpp
```c++
import m;
int main() {
 f(A{});
}
```

See https://compiler-explorer.com/z/v4xdnT7eW.

Error since Clang 20:
```console
main.cpp:3:5: error: use of undeclared identifier 'f'
    3 |     f(A{});
      |     ^
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsU8GO4zYM_Rr6QiSQqXi9OfjgTCa37aEN0LMi0YlaWTIkeZD26xeyvTszwAACLFAk33vks0rJ3j1zB80JmnOl5vwIsfuh7uyzukbmR5gTV7dg_uvGvZ6mEUQP38R6NNCpHNHzcwox4xjM7BhHkCWYcpx1xpNKjNCWCCJi5nFyKjOCfNFOpYRXkK_b4xAte4M6-JT5OUVUcw44AH2_Ah1LF4yc5-hRgDwhtOfCpz2vgBuLDbcH2b-D_8r5Tb7cRT8q64uur2XZcZW1llqfseQDfd_IFNaFXL8h0HEDWXl9hvqLGR85TwlkD3QBuugwTtZx3PFzciFy3OswAl3-B7q8HZ7GX1v-e79Wv8YYIibrNeOLU_6OJEqjj7yDT8HxR1WylyD7pkyCS4NymRNjGHD2hrVTkQ1awz7bwXJEoHYAard1SIT2BZfFfKFyefidAc3rRzKV6aQ5yqOquKvbgzzQUdZUPbpD3Zhh0ERaDKLRJAauhZRHrcnwMJjKdiSoEVLWtWyamvYHKeSgbpKO35qWhxYOgkdl3d65t3Ef4r2yKc3c1VK2JCqnbuzSYmkiXUYFRMXdsSsFu9t8T3AQzqac3ltkm93yHyzDheYMzelPvkdOyQYPsiexBn8sHk_QnPEPNTK6EP6dJxyUdWywuNV6gw9rDPtffrYeffC71Z9s8FZcuZi_mqPrPrvibvNjvm1WKPy2z26K4R_WGeiy6E1Al03yW0c_AwAA___ARRzB">