Skip to content

Commit 9dddb3d

Browse files
authored
[AST] Mark the fallthrough coreturn statement implicit. (#77465)
This is a followup of #77311.
1 parent 149ed9d commit 9dddb3d

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

clang/lib/Sema/SemaCoroutine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() {
17481748
return false;
17491749
} else if (HasRVoid) {
17501750
Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr,
1751-
/*IsImplicit*/false);
1751+
/*IsImplicit=*/true);
17521752
Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get());
17531753
if (Fallthrough.isInvalid())
17541754
return false;

clang/test/AST/ast-dump-coroutine.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ Task test() {
5252
// CHECK-NEXT: |-CXXMemberCallExpr {{.*}} 'std::suspend_always'
5353
// CHECK-NEXT: | | `-MemberExpr {{.*}} .initial_suspend
5454
// ...
55-
// FIXME: the CoreturnStmt should be marked as implicit
56-
// CHECK: CoreturnStmt {{.*}} <col:6>{{$}}
55+
// CHECK: CoreturnStmt {{.*}} <col:6> implicit
5756

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

0 commit comments

Comments
 (0)