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

    <tr>
        <th>Summary</th>
        <td>
            [clang] Deduction guides in anonymous namespaces or nested classes trigger -Wunused-function
        </td>
    </tr>

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

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

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

<pre>
    Summary: Unused deduction guides in anonymous namespaces or for nested classes trigger `-Wunused-function`.

Example error message:
```
<source>:12:3: error: unused function '<deduction guide for Bar>' [-Werror,-Wunused-function]
 12 |   Bar() -> Bar<0>;
      |   ^~~
```

Reproducer: https://godbolt.org/z/zW1KWdK84

This is basically the same failure mode as https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106604.

Appears to occur on all existing releases of clang.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUk8uuszYUhZ9mM9kKMjYkMGBALkz-WS_KsDJmQ1wZO_Ll78kZnGevIKkq5aiDIhBIeH1eS3tZhqBnS9RCdYTqnMkUb8630i_Sjm5xNkpLn9ngxkf7a1oW6R8gOvzdpkAjjjQmFbWzOCc9UkBtUVpnH4tLAa1cKNylooDO4-Q8WgqRRlRGhkABo9fzTB5hz3bXtCF3U7IbEfYsB9YB6y4fcrkbQvLeeVwoBDkTiPUX7NnrZh2IU3DJKwJxAdEVHEQnVq-bbv147oD_7IDADyBObxk2n0fpVwo_IFTH3fVJ4KfvJqszsA4LjnA4IW46XgNvcAfi8sSc2GbouC7crudSqC5fX-8RWPcL3b0bk6LN8S3Ge1ij8h54P7txcCbmzs_A-8_1uRY_ruOPunyKf7vpgDrgIINW0pgHxhthkAvhJLVJnnBxI6EM72Sl8tmmF3lI86c2RgLvw8399ceQ5lzNGkSvRxDngu33rHwNp7vfSfqA0aFTKnl0FqUxSB86RG1n9GRIrsN20zp3O-fZ2IqxEY3MqC0OZc34_lCV2a1tmCQlZCXUMAhxqEsxNeU0VlNZV6osm0y3nPGKVVwUddUUZS5qWU98Xx54MTSy4FAyWqQ2uTE_lzVNpkNI1BZlwesiM3IgE7aqc76ZAc7X1vt2FeyGNAcomdEhhn8RUUeznY-nojrj-X_U_j8q_61KWfKmfZuKjrc05MotwPvVzuu1u3v3J6kIvN_iBeD9K-HPlv8dAAD__3AtOJw">