[clang] Do not discard cleanups while processing immediate invocation
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Fri, 30 Jun 2023 08:21:43 +0000 (04:21 -0400)
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Fri, 30 Jun 2023 08:50:08 +0000 (04:50 -0400)
commit550fa4eabd83d133595c7a5a07d54fc029b73733
tree2e6f5ea9acefcb40e855c7b4bdc439856595c2b2
parent3a9ea6a48a7092b89515f4c3e2b2b6d5851b2b61
[clang] Do not discard cleanups while processing immediate invocation

Since an immediate invocation is a full expression itself - it requires
an additional ExprWithCleanups node, but it can participate to a bigger
full expression which actually requires cleanups to be run after.

Thanks @ilya-biryukov for helping reducing the reproducer and confirming
that the analysis is correct.

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

Reviewed By: ilya-biryukov

Differential Revision: https://reviews.llvm.org/D153962
clang/docs/ReleaseNotes.rst
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGenCXX/consteval-cleanup.cpp [new file with mode: 0644]
clang/test/SemaCXX/consteval-cleanup.cpp [new file with mode: 0644]