[libcxx-commits] [PATCH] D103196: [libcxx][nfc] Fix the ASAN bots: update expected.pass.cpp.

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 26 12:02:35 PDT 2021


zoecarver created this revision.
zoecarver added reviewers: ldionne, Quuxplusone.
Herald added a subscriber: lxfind.
zoecarver requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103196

Files:
  libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp


Index: libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
===================================================================
--- libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
+++ libcxx/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
@@ -35,7 +35,7 @@
 
   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 = {}; }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103196.348049.patch
Type: text/x-patch
Size: 802 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210526/29d649f7/attachment.bin>


More information about the libcxx-commits mailing list