Skip to content

Commit 17afb4c

Browse files
committed
[AST] Mark the fallthrough coreturn statement implicit.
1 parent 98c6aa7 commit 17afb4c

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
@@ -1743,7 +1743,7 @@ bool CoroutineStmtBuilder::makeOnFallthrough() {
17431743
return false;
17441744
} else if (HasRVoid) {
17451745
Fallthrough = S.BuildCoreturnStmt(FD.getLocation(), nullptr,
1746-
/*IsImplicit*/false);
1746+
/*IsImplicit*/true);
17471747
Fallthrough = S.ActOnFinishFullStmt(Fallthrough.get());
17481748
if (Fallthrough.isInvalid())
17491749
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)