[clang] Reset track of immediate function context when entering new function
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Thu, 6 Apr 2023 08:34:07 +0000 (04:34 -0400)
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Thu, 6 Apr 2023 10:35:26 +0000 (06:35 -0400)
commit55bbcbf511b4df0dfe524b2d06fc561a939c6b16
treed2fd823a1c6c599460d3b9ec0afd0370e3820004
parent93fb1bac674b07134f7de59ba22d3d5acf741637
[clang] Reset track of immediate function context when entering new function

Due to not resetting that, clang still thinks that it is in immediate
function context even if it already entered non-consteval function.
This caused consteval functions reaching codegen in some cases.

Fixes https://github.com/llvm/llvm-project/issues/61142

Reviewed By: cor3ntin, aaron.ballman

Differential Revision: https://reviews.llvm.org/D147531
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaDecl.cpp
clang/test/CodeGenCXX/cxx20-consteval-crash.cpp