D115187 exposed CoroutineSuspendExpr's operand, which makes some nodes to show up twice during the traversal, confusing the check for unsequenced operations. Skip the operand since it's already handled as part of the common expression and get rid of the misleading warnings.
Details
Diff Detail
Event Timeline
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
15251 | Out of curiosity, since getCommonExpr() is itself a subexpression of getReadyExpr(), getSuspendExpr(), and getResumeExpr() (which are also children of the CoroutineSuspendExpr), shouldn't getCommonExpr() be skipped for the same reason? |
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
15251 |
This looks not true. For this example: co_await foo(); foo() is the Operand. And the Common is auto __tmp__ = operator co_await(foo()). ReadyExpr should be __tmp__.await_ready();. SuspendExpr should be __tmp__.await_suspend(); and ResumeExpr should be __tmp__.await_resume();. So the method here looks good to me. |
Thanks for the review, will push once all tests pass!
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
15251 |
Exactly! |
Only test failing is ClangScanDeps/modules-full.cpp on Windoes, which is unrelated to this change.
clang/lib/Sema/SemaChecking.cpp | ||
---|---|---|
15251 | Thank you for the explanation! I overlooked the fact that ReadyExpr/SuspendExpr/ResumeExpr use an OpaqueValueExpr wrapping CommonExpr rather than using CommonExpr directly. |
Out of curiosity, since getCommonExpr() is itself a subexpression of getReadyExpr(), getSuspendExpr(), and getResumeExpr() (which are also children of the CoroutineSuspendExpr), shouldn't getCommonExpr() be skipped for the same reason?