Fix a failing assertion with implicit function definitions
authorAaron Ballman <aaron@aaronballman.com>
Fri, 23 Jun 2023 11:02:21 +0000 (07:02 -0400)
committerAaron Ballman <aaron@aaronballman.com>
Fri, 23 Jun 2023 11:02:21 +0000 (07:02 -0400)
commit63342ae4b8f7573fd03fdb6eb38d55097b9a6922
tree2b0e408b27a173c86446638b7e77a41279332eac
parent041ffc155fd7d154af1ea59853fbe5932d0216d3
Fix a failing assertion with implicit function definitions

When implicitly defining a function in C, we would try to find an
appropriate declaration context for the function to be declared within.
However, we did not account for GNU statement expressions, which
masquerade as a compound statement and can be used in other contexts
such as within structure member declarations.

Fixes https://github.com/llvm/llvm-project/issues/48579
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDecl.cpp
clang/test/Sema/implicit-decl.c