llvm-project
llvm-project copied to clipboard
[clang] Adding cfi_unchecked_callee in function type conversion suppresses diagnosis regarding other info
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.
CC: @PiJoules