Skip to content

[AST] Mark the fallthrough coreturn statement implicit. #77465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/Sema/SemaCoroutine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() {
return false;
} else if (HasRVoid) {
Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr,
/*IsImplicit*/false);
/*IsImplicit=*/true);
Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get());
if (Fallthrough.isInvalid())
return false;
Expand Down
6 changes: 2 additions & 4 deletions clang/test/AST/ast-dump-coroutine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ Task test() {
// CHECK-NEXT: |-CXXMemberCallExpr {{.*}} 'std::suspend_always'
// CHECK-NEXT: | | `-MemberExpr {{.*}} .initial_suspend
// ...
// FIXME: the CoreturnStmt should be marked as implicit
// CHECK: CoreturnStmt {{.*}} <col:6>{{$}}
// CHECK: CoreturnStmt {{.*}} <col:6> implicit

Task test2() {
// Writen souce code, verify no implicit bit for the co_return expr.
Expand All @@ -65,5 +64,4 @@ Task test2() {
// CHECK: |-DeclStmt {{.*}}
// CHECK-NEXT: | `-VarDecl {{.*}} implicit used __promise
// ...
// FIXME: the CoreturnStmt should be marked as implicit
// CHECK: CoreturnStmt {{.*}} <col:6>{{$}}
// CHECK: CoreturnStmt {{.*}} <col:6> implicit