Skip to content

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

Closed as not planned
@jroelofs

Description

@jroelofs

https://clang.godbolt.org/z/7zdKf8M9r

__attribute__((target_version("fp16")))
static int foo(void) { return 1; }

__attribute__((target_version("fp16fml")))
static int foo(void) { return 2; }

__attribute__((target_version("default")))
static int foo(void) { return 0; }

int caller() {
    return foo();
}

-Wunused-function -Werror

<source>:2:12: error: unused function 'foo' [-Werror,-Wunused-function]
    2 | static int foo(void) { return 1; }
      |            ^~~
<source>:5:12: error: unused function 'foo' [-Werror,-Wunused-function]
    5 | static int foo(void) { return 2; }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerduplicateResolved as duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions