llvm-project
llvm-project copied to clipboard
[Clang][Windows] `-Wctad-maybe-unsupported` triggered for `std::equal_to`
The following code, when using MSVC STL, triggers the clang warning enabled by -Wctad-maybe-unsupported.
#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++.
CC @hokein