[clang] 33a1181 - [NFC] [FlowSensitive] [StatusOr] add test for co_return (#192160)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 15 09:53:36 PDT 2026


Author: Florian Mayer
Date: 2026-04-15T09:53:31-07:00
New Revision: 33a1181470db75e284b091267d431ed15e12843c

URL: https://github.com/llvm/llvm-project/commit/33a1181470db75e284b091267d431ed15e12843c
DIFF: https://github.com/llvm/llvm-project/commit/33a1181470db75e284b091267d431ed15e12843c.diff

LOG: [NFC] [FlowSensitive] [StatusOr] add test for co_return (#192160)

Added: 
    

Modified: 
    clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp
index eaf14eceb8d67..08c89818a645d 100644
--- a/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/UncheckedStatusOrAccessModelTestFixture.cpp
@@ -4557,6 +4557,21 @@ TEST_P(UncheckedStatusOrAccessModelTest, CoroutineCoReturn) {
   )cc");
 }
 
+TEST_P(UncheckedStatusOrAccessModelTest, CoroutineCoReturnEnds) {
+  ExpectDiagnosticsFor(R"cc(
+#include "unchecked_statusor_access_test_defs.h"
+#include "task.h"
+
+  Task<int> target(STATUSOR_INT sor) {
+    if (!sor.ok()) {
+      co_return 0;
+    }
+    *sor;
+    co_return 1;
+  }
+  )cc");
+}
+
 } // namespace
 
 std::string


        


More information about the cfe-commits mailing list