ChuanqiXu added inline comments.

================
Comment at: clang/unittests/Format/FormatTest.cpp:22735
+  verifyFormat("co_await a; // comment");
+  verifyFormat("void test0() { co_await a; }");
+}
----------------
It may be worth to add following tests:
```
co_await co_await co_await foo();
co_await foo().bar();
co_await [this](int a, int b) -> Task {\n
    co_return co_await foo();\n
}(x, y);
co_await [this]() -> Task { co_return x; }
```



================
Comment at: clang/unittests/Format/FormatTest.cpp:22748-22749
+TEST_F(FormatTest, CoRoutinereturn) {
+  verifyFormat("int x = co_return foo();");
+  verifyFormat("int x = (co_return foo());");
+  verifyFormat("co_return (42);");
----------------
These two statements looks invalid.


================
Comment at: clang/unittests/Format/FormatTest.cpp:22752
+  verifyFormat("co_return;");
+  verifyFormat("co_return {};");
+}
----------------
I think it would be better to add two tests:
```
co_return x;
co_return co_await foo();
co_return co_yield foo();
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114859/new/

https://reviews.llvm.org/D114859

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to