forked from OSchip/llvm-project
[libcxx][nfc] Fix the ASAN bots: update expected.pass.cpp.
Ensures that `get_return_object`'s return type is the same as the return type for the function calling `co_return`. Otherwise, we try to construct an object, then free it, then return it. Differential Revision: https://reviews.llvm.org/D103196
This commit is contained in:
parent
5f8810d7b4
commit
52123c96c0
|
@ -35,7 +35,7 @@ struct expected {
|
|||
|
||||
struct promise_type {
|
||||
std::shared_ptr<Data> data;
|
||||
std::shared_ptr<Data> get_return_object() { data = std::make_shared<Data>(); return data; }
|
||||
expected get_return_object() { data = std::make_shared<Data>(); return {data}; }
|
||||
suspend_never initial_suspend() { return {}; }
|
||||
suspend_never final_suspend() noexcept { return {}; }
|
||||
void return_value(T v) { data->val = v; data->error = {}; }
|
||||
|
|
Loading…
Reference in New Issue