Skip to content

[FMV] -Wunused-function incorrectly complains about versioned static functions #80227

Closed
@jroelofs

Description

@jroelofs

https://clang.godbolt.org/z/9G6YT4eYc

extern "C" void fast(void);
extern "C" void slow(void);

__attribute__((target_version("i8mm")))
static void callee(void) { fast(); }

__attribute__((target_version("default")))
static void callee(void) { slow(); }

int main() {
    callee();
}

--rtlib=compiler-rt -Werror=unused-function -Wall

<source>:5:13: error: unused function 'callee' [-Werror,-Wunused-function]
    5 | static void callee(void) { fast(); }
      |             ^~~~~~
1 error generated.
Compiler returned: 1

Metadata

Metadata

Assignees

Labels

backend:AArch64clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions