================ @@ -1,7 +1,35 @@ -// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunneeded-internal-declaration -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c -verify %s +// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wunused -x c++ -verify %s + +#ifdef __cplusplus +extern "C" { +#else // expected-no-diagnostics +#endif static int f(void) { return 42; } int g(void) __attribute__((alias("f"))); static int foo [] = { 42, 0xDEAD }; extern typeof(foo) bar __attribute__((unused, alias("foo"))); + +static int (*resolver(void))(void) { return f; } +int ifunc(void) __attribute__((ifunc("resolver"))); + +#ifdef __cplusplus +} + +/// We demangle alias/ifunc target and mark all found functions as used. +static int f1(int) { return 42; } ---------------- MaskRay wrote:
Added AST::createMangleContex and avoided false positives. 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