[PATCH] D114859: [clang-format] Add better support for co-routinues

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 1 04:53:18 PST 2021


ChuanqiXu added inline comments.


================
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);");
----------------
MyDeveloperDay wrote:
> ChuanqiXu wrote:
> > These two statements looks invalid.
> do you mean these two?
> 
> ```
> verifyFormat("int x = co_return foo();");
> verifyFormat("int x = (co_return foo());");
> ```
> 
> I lifted these from {D34225}
yeah, since it is meaningless to me since we couldn't evaluate the value of `co_return` expression.


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

https://reviews.llvm.org/D114859



More information about the cfe-commits mailing list