mirror-llvm-project/clang
Sirraide f918c2880d
[Clang] [Sema] Use getCurFunctionDecl() to get the current function (#211938)
In `BuildReturnStmt()`, use `getCurFunctionDecl()` to get the current
function rather than attempting to cast `CurContext` to a
`FunctionDecl`, which breaks inside an expansion statement because the
current `DeclContext` will be that of the expansion statement, not the
function. `getCurFunctionDecl()` knows how to handle this case and we
already call it earlier in that function, so just reuse the result of
that call.

Fixes #211917.

(cherry picked from commit a891a5c40c)
2026-07-27 20:05:30 +02:00
..
bindings [clang] workaround libclang-python windows CI failures (#207875) 2026-07-07 01:07:25 +00:00
cmake Revert "Reapply "runtimes: Pass CMAKE_SYSTEM_NAME based on target triple" (#205133) (#205522)" (#208644) 2026-07-10 08:58:58 +00:00
docs Revert "[analyzer] Model strchr/strrchr/memchr/strstr/strpbrk/strchrnul (#207267)" 2026-07-26 20:20:53 +02:00
examples [PassManager] Make passes inherit from RequiredPassInfoMixin/OptionalPassInfoMixin (#192120) 2026-05-06 10:00:07 -07:00
include [analyzer][z3] Fix crash in Z3 SMTConv when casting atomic int (#211489) 2026-07-23 16:26:32 +02:00
lib [Clang] [Sema] Use getCurFunctionDecl() to get the current function (#211938) 2026-07-27 20:05:30 +02:00
runtime
test [Clang] [Sema] Use getCurFunctionDecl() to get the current function (#211938) 2026-07-27 20:05:30 +02:00
tools Revert "clang-linker-wrapper: Use AMDGPU::TargetID for device-image compatibility" (#209407) 2026-07-14 09:43:44 +00:00
unittests [analyzer] Uplift UnSatAtErrorNodeDueToRefinedConstraint test after smarter range inference (#209443) 2026-07-14 14:16:13 +01:00
utils [clang][bytecode] Remove EvalEmitter::OpPC (#208988) 2026-07-12 09:12:32 +02:00
www Revert "[Clang] Allow devirtualization involving array subscripts with constant indices when the pointee type is known [CWG1504] (#207540) (#209596) 2026-07-15 10:07:19 +00:00
.clang-format
.clang-tidy
.gitignore
AreaTeamMembers.txt
CMakeLists.txt Add build option CLANG_INCLUDE_EXAMPLES (#187317) 2026-07-11 04:27:34 +02:00
INSTALL.txt
LICENSE.TXT
Maintainers.md Nominate Joshua Cranmer as floating-point maintainer (#198287) 2026-05-18 10:53:29 -04:00
NOTES.txt
README.md

C language Family Front-end

Welcome to Clang.

This is a compiler front-end for the C family of languages (C, C++ and Objective-C) which is built as part of the LLVM compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things beyond just compiling code: we intend for Clang to be host to a number of different source-level tools. One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read the relevant websites. Here are some pointers: