diff options
author | Bruno De Fraine <brunodf@synopsys.com> | 2025-10-09 17:30:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-09 17:30:25 +0200 |
commit | a03aef4faedb06ac0a70846dc4deeffd0ee4bff0 (patch) | |
tree | a2bb7aae974d42a03906a1e0657977541e295819 /libcxx/test/std/thread/thread.jthread/swap.free.pass.cpp | |
parent | 5ba3b523069f92e2d2f0971cd75b056cb8d2a928 (diff) | |
download | llvm-a03aef4faedb06ac0a70846dc4deeffd0ee4bff0.zip llvm-a03aef4faedb06ac0a70846dc4deeffd0ee4bff0.tar.gz llvm-a03aef4faedb06ac0a70846dc4deeffd0ee4bff0.tar.bz2 |
[Clang] [Sema] Fix incomplete C mode incompatible ExtInfo/ExtProtoInfo conversion diagnostic (#160477)
To raise -Wincompatible-function-pointer-type for extended function type
information conversions in C mode, checkPointerTypesForAssignment
contained an invocation of IsFunctionConversion that is quite dubious:
it verifies the conversion from LHS to RHS, while we are converting from
RHS to LHS. Presumably, this was done because result and argument types
don't have to match exactly in C mode (compatible types is sufficient),
while IsFunctionConversion checks that an exact match in function types
can be obtained by transforming extended function type information. As a
result of the dubious invocation, the diagnostic for incompatible
extended function type changes was incomplete and would illogically
disappear when other changes to the function type were involved (this
was already raised in 2019 but left unsolved). Newer additions of
extended function type information such as "cfi_unchecked_callee", ARM
CMSE attributes, ARM SME attributes, and function effect attributes,
worked around the issue by introducing either holes or additional checks
which complicates the logic.
Here, we solve this longstanding issue by using IsFunctionConversion to
verify the extended function type information conversion in the correct
direction (from RHS to LHS), after first removing other differences in
the function type (argument and result type mismatch, prototype vs. no
prototype) to allow IsFunctionConversion to obtain an exact match. The
complications introduced for checking newer attributes are removed.
Fixes #41465
Fixes #85415
Diffstat (limited to 'libcxx/test/std/thread/thread.jthread/swap.free.pass.cpp')
0 files changed, 0 insertions, 0 deletions