llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

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

Open brunodf-gf opened this issue 1 year ago • 1 comments

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.

brunodf-gf avatar Oct 10 '25 08:10 brunodf-gf

CC: @PiJoules

ilovepi avatar Oct 10 '25 15:10 ilovepi