Skip to content

[clang] Adding cfi_unchecked_callee in function type conversion suppresses diagnosis regarding other info #162798

@brunodf-snps

Description

@brunodf-snps

C++ test case:

void f();

// adding cfi_unchecked_callee is OK
void (*fptr1)() __attribute__((cfi_unchecked_callee)) = &f;

// adding noreturn is NOT ok
void (*fptr2)() __attribute__((noreturn)) = &f;

// BUG: adding cfi_unchecked_callee absolves adding noreturn ??
void (*fptr3)() __attribute__((cfi_unchecked_callee,noreturn)) = &f;

Godbolt demo: https://godbolt.org/z/1P4onfG7K

There was a similar issue for the conversion in C mode. This was part of a larger issue that was resolved in #160477.

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang: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