llvm-project
llvm-project copied to clipboard
clang-tidy misc-unused-parameters check not working for coroutines
Repro at https://godbolt.org/z/x3sjdsxsq using clang 18 and trunk.
void f(int x) // warning: parameter 'x' is unused [misc-unused-parameters]
{
std::cout << std::endl;
}
task f_async(int x) // should warn
{
std::cout << std::endl;
co_return;
}
Interestingly enough, this is caught with -Wunused-parameter see:
test_coroutines.cpp:18:18: warning: unused parameter 'my_param' [-Wunused-parameter]
18 | task f_async(int x)
|