================ @@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple %ms_abi_triple -Wunused -verify=expected,cxx %s + +#ifdef __cplusplus +extern "C" { +#endif +static int f(void) { return 42; } // cxx-warning{{unused function 'f'}} +int g(void) __attribute__((alias("f"))); + +static int foo [] = { 42, 0xDEAD }; +extern typeof(foo) bar __attribute__((unused, alias("foo"))); + +static int __attribute__((overloadable)) f0(int x) { return x; } // expected-warning{{unused function 'f0'}} +static float __attribute__((overloadable)) f0(float x) { return x; } // expected-warning{{unused function 'f0'}} +int g0(void) __attribute__((alias("?f0@@YAHH@Z"))); ---------------- nickdesaulniers wrote:
got it; please add a TODO that the overload of `f0` that accepts an `int` should not warn (similar to the TODO you added in clang/test/Sema/alias-unused.cpp for the namespace part. Same for `g1` and the overload of `f3` that accepts no parameters. https://github.com/llvm/llvm-project/pull/87130 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits