I believe I have seen this warning before with “static” template functions and template functions in anonymous namespaces. If the static key word is removed then the warning goes away. You could still specify hidden linkage if really needed.
Looking at the history of the file where I struggled with this warning there were a couple different issues that may have been causing problem. I believe this patch was the one that addressed the warning for me:
Contrary to what I initially said, this appear to have added the ‘inline’ keyword to the function.
I see two answers that are very interesting: The first one:
-Wunused-function
Warn whenever a static function is declared but not defined or a non-inline static function is unused. This warning is enabled by -Wall.
Which is followed by the comment:
static inline doesn’t (always) suppress this for clang. – robertwb Nov 16 '16 at 0:52
From your dashboard result, I see that you are using clang, which might explain why the solution given by @blowekamp does solve the issue completely.
Now there is another solution that I think is interesting for this question:
void foo (int, int) attribute ((unused));
It would be interesting to set this attribute and see if that solves your issue. We could then create a patch for ITK if that works.