[clang-tidy] Is there any way to change function return type for all declarations?

Hi folks,

Is there any way to change function return type for all declarations? My use case is:

int foo(); // may be in header

int foo() {

return true;

return false;
}

I would like to find functions that have return type of int, but they have all return statements returning bool, and then change the return type of this function (for each declaration) to bool.

The matching is duable, but I am wondering if it is possible to do this fixit. Is there any way to get all declarations of some function?

Also, what happen if I would not see one declaration in this TU, f.e. because this TU would not include header. I would’t want it to result in UB.

Best

Piotr