llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

clang-tidy misc-unused-parameters check not working for coroutines

Open bartdesmet opened this issue 2 years ago • 1 comments

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;
}

bartdesmet avatar Jul 25 '24 21:07 bartdesmet

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)
      |  

RiverDave avatar Apr 06 '25 00:04 RiverDave