[llvm-branch-commits] [libcxx] 0d6fc85 - [🍒][libcxx][nfc] Fix the ASAN bots: update expected.pass.cpp.

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jun 17 05:50:04 PDT 2021


Author: zoecarver
Date: 2021-06-16T13:42:47-04:00
New Revision: 0d6fc8550b58d5993858de52e330e01e109ddff9

URL: https://github.com/llvm/llvm-project/commit/0d6fc8550b58d5993858de52e330e01e109ddff9
DIFF: https://github.com/llvm/llvm-project/commit/0d6fc8550b58d5993858de52e330e01e109ddff9.diff

LOG: [🍒][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

(cherry picked from commit 52123c96c016143ebfff6de76fe83cebd6c1d726)

Added: 
    

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

Removed: 
    


################################################################################
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 2bd297660c4ed..5b307508abeb5 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> 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 = {}; }


        


More information about the llvm-branch-commits mailing list