From 52123c96c016143ebfff6de76fe83cebd6c1d726 Mon Sep 17 00:00:00 2001 From: zoecarver Date: Wed, 26 May 2021 12:00:03 -0700 Subject: [PATCH] [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 --- .../support.coroutines/end.to.end/expected.pass.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp b/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp index 2bd297660c4e..5b307508abeb 100644 --- a/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp +++ b/libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp @@ -35,7 +35,7 @@ struct expected { struct promise_type { std::shared_ptr data; - std::shared_ptr get_return_object() { data = std::make_shared(); return data; } + expected get_return_object() { data = std::make_shared(); return {data}; } suspend_never initial_suspend() { return {}; } suspend_never final_suspend() noexcept { return {}; } void return_value(T v) { data->val = v; data->error = {}; }