<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/96451>96451</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang][Windows] `-Wctad-maybe-unsupported` triggered for `std::equal_to`
</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>
The following code, when using MSVC STL, triggers the clang warning enabled by `-Wctad-maybe-unsupported`.
```cpp
#include <functional>
int main() { return std::equal_to{}(-1, 1); }
```
```
.\test.cpp:12:9: warning: 'equal_to' may not intend to support class template argument deduction [-Wctad-maybe-unsupported]
12 | return std::equal_to{}(-1, 1);
| ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.40.33807\include\xutility:510:8: note:
add a deduction guide to suppress this warning
510 | struct equal_to {
| ^
1 warning generated.
```
This use of CTAD doesn't look harmful. The warning seems not triggered when using libc++.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4zYM_TXMhYghy1YcH3xInObUAQpMMHssZIu21cpSqo-dnX9fKJNMpx-LYgUDtmiKfO-JpAxBz5aoA3EEcdrIFBfnuyc5k43y4okWlwJtBqfeustCODlj3Ku2M45OEfAeXxeymEI2PT2_9Ph8-Tmbo9fzTD5gXAhHI-2Mr9Lb7EZWDoYUDm8IO7b9Mkaptqt8G2ibbEjXq_ORFOxYAewE7AA79v6M1-vdwittR5MUIVT9lOwYtbPSQPXTu4O2EVepLfA98BahOaKnmLzFEBVUB6gO9EeS5tfooDlCcwK-35YZdwm8heqI2fb37P-5LUD0kUIsMrbqUHKoDi1UhwfZ_Am8-UjGG1zlG1oXUdtIVmF0eOecZQoBI61XIyOh9HNayUZUpNKNId4WiON3RRN31IhYcoSmx8f6Mf4fUXK-T1HwAeEudJ-Dif4X72YvVzxrQwGB77_tdzmQ6J_06F1wU8QXHZI0-ByT0g5EzxnnIPpj0kZdnDMBRP_Sg-gfm1xOIPqyLmpWVNWeNSD6-72D6L-lqI2Ob1AdRMmgOuyz2NZFypg-4ZdKofwk4py0oofunrLkiw4fN3Y_KUp2Yx6iT2PEh1y5lr4jzoco5Uepz2TJy0jqn6X8vr3kvCkQugn7y-GEylGwwJuIxrnfcZF-nZIpMLfeI2YgWsOtgu49RupzExo9jMCPwI_FRnWVaqtWbqgrm7LlrGSN2Cxd2e4HVra8lVJJqnaSNXKqxK5WrGl5PW10xxmv2Y7XrBJlKQqqmnoSpSynUfKxHaBmtEptCmO-roXz80aHkKhrd7UoN0YOZMJtqHB-a37Id33a-C77b4c0B6iZ0SGGvyJEHc1tEvW3E-IE4vhFW-VeA4jT_8yKT2JMzmfnf1f6jm2SN90S4zXkX_wM_DzruKShGN0K_Jyx3F_bq3e_0RiBn2_UAvDzO7uvHf8zAAD__94Mk4k">