<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/67942>67942</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
GCC warns -Wnon-template-friend on LLVM
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
danakj
</td>
</tr>
</table>
<pre>
Clang does [not have this warning](https://github.com/llvm/llvm-project/issues/23716) but GCC is finding this mistake in LLVM 18 due to a recent change.
```
/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:213:59: warning: friend declaration ‘bool llvm::operator==(const PagedVector<T, PageSize>::MaterializedIterator&, const PagedVector<T, PageSize>::MaterializedIterator&)’ declares a non-template function [-Wnon-template-friend]
213 | MaterializedIterator const &RHS);
| ^
/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:213:59: note: (if this is not what you intended, make sure the function template has already been declared and add ‘<>’ after the function name here)
/usr/lib/llvm-18/include/llvm/ADT/PagedVector.h:215:59: warning: friend declaration ‘bool llvm::operator!=(const PagedVector<T, PageSize>::MaterializedIterator&, const PagedVector<T, PageSize>::MaterializedIterator&)’ declares a non-template function [-Wnon-template-friend]
215 | MaterializedIterator const &RHS);
| ^
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzcVVGL4zYQ_jXjlyHBHtmJ_eAHJ9m0hTsoveP6LFtjW3eOFCT5lr1fX-Qku9uydKHkodwgJCLFn76Z-UYjvdeDYa6h2EFxSOQcRutqJY389jVprXqq95M0AyrLHqHYGRtwlN8Zw6g9PkpntBmgOACVYwhnD6IBOgIdBx3GuV139gR0nKbvt2V1dvYrdwHoqL2f2QMdSWyzDVCF7Rzwl_0etcdeG6XNcLnnpH2Q3xi1wQ8fvnzErEQ1MwaLEh13bAJ2ozQDryE9QNpc5016HZefdJy9izR0eyOTlZGH6aZZ8QvP5vAZ6Pi7HFh94S5Ytx5BNJQJEE1RgWieHRcN9k6zUai4m6STQVuD8EBQplCVrbUTLqCiAdHYMzsZrANxiIPKzhof8NVFIPafgfbL1if9g0E8XD79KAM7LSf9g9Vv4QpDm_jfO4BUN8bV1Q_2KNFYswp8Ok8yMPaz6S7OFbvVn6-PVpcIRBEscUakTCBs9_gv9haVqydAmz9-_RRJid0NMdo7iO8YFA_3l4GxgeMKVOr-IlXt4y4-jjLgk51Rm8BGsYoJOUUN-9nF6nkV0ecYj9KjnBxL9YQts7klQ6E0CqVSL8oCsY9pfU6b7AO7v8MaeWIc2XEM5Z1cL-5VAZT95BVQ_I8r4B_v4jInqhaqEpVMuM421YayIsspGetKFJz2TJXo87bNsjLLcpJ5nvZZmZZtmuiaUhJZmlJKBRGtt22Rb_OcRUFlwSVBnvJJ6mkddbC2bkiWl7_ebKuckkm2PPmlAREZfsTlEIhiP3L1ItJ2Hjzk6aR98C8oQYeJ69gvohg9vpkUtJeekcxuqv97i1q4_hUAAP__LLgj3Q">