[PATCH] Suppress 'unused function' warnings on specialized template functions

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Apr 15 10:01:05 PDT 2013


On 10 April 2013 17:05, Halfdan Ingvarsson <halfdan at sidefx.com> wrote:
> Hello
>
> This is my first patch submission, although I've been using clang as my
> primary work compiler for over a year.
>
> It's a simple suppression on unused function warnings (-Wunused-function)
> for specialized template functions, whose primary template has a static
> storage class. E.g:
>
> ---- 8< ----
> template<typename T> static inline bool
> isNonZero(T a) { return (bool)a; }
>
> template<> inline bool
> isNonZero(const char *s) { return s; }
> ---- 8< ---
>
> Currently the second definition will emit an unused warning.
>

Can you include a testcase in the patch?

Thanks,
Rafael



More information about the cfe-commits mailing list