[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:
zoecarver 2021-05-26 12:00:03 -07:00
parent 5f8810d7b4
commit 52123c96c0
1 changed files with 1 additions and 1 deletions

View File

@ -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 = {}; }