aboutsummaryrefslogtreecommitdiff
path: root/lldb/packages/Python/lldbsuite/test/gdbclientutils.py
diff options
context:
space:
mode:
authorUtkarsh Saxena <usx@google.com>2024-01-19 08:23:25 +0100
committerGitHub <noreply@github.com>2024-01-19 08:23:25 +0100
commit498e1c2257da552abc58aa75f6b9f776bf826f86 (patch)
tree68c5219737b8dfe86fdeaee8176fadd627dbcf2c /lldb/packages/Python/lldbsuite/test/gdbclientutils.py
parent461679f2925220f350c6bafb2d661c309c5e3ae8 (diff)
downloadllvm-498e1c2257da552abc58aa75f6b9f776bf826f86.zip
llvm-498e1c2257da552abc58aa75f6b9f776bf826f86.tar.gz
llvm-498e1c2257da552abc58aa75f6b9f776bf826f86.tar.bz2
[coroutine] Create coroutine body in the correct eval context (#78589)
Fixes: https://github.com/llvm/llvm-project/issues/78290 See the bug for more context. ```cpp Gen ACoroutine() { if constexpr (0) // remove it make clang compile. co_return; co_await Gen{}; } ``` We miss symbol of ctor of promise_type if the first coroutine statement happens to be inside the disabled branch of `if constexpr`. This happens because the promise object is built when we see the first coroutine statement which is present in `ExpressionEvaluationContext::DiscardedStatement` context due to `if constexpr (0)`. This makes clang believe that the promise constructor is only odr-used and not really "used". The expr evaluation context for the coroutine body should not be related to the context in which the first coroutine statement appears. We override the context to `PotentiallyEvaluated`. --------- Co-authored-by: cor3ntin <corentinjabot@gmail.com>
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/gdbclientutils.py')
0 files changed, 0 insertions, 0 deletions