Skip to content

Commit f18b196

Browse files
committed
NFC: Suppress a -Wunreachable-code warning in GlobalExecutor.cpp.
The `swift_unreachable()` is currently statically unreachable but we'd like to leave it in place in case the control flow before it changes in the future.
1 parent 00da82d commit f18b196

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stdlib/public/Concurrency/TaskGroup.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,7 +1381,12 @@ void DiscardingTaskGroup::offer(AsyncTask *completedTask, AsyncContext *context)
13811381
_swift_taskGroup_detachChild(asAbstract(this), completedTask);
13821382
return unlock();
13831383
}
1384+
#pragma clang diagnostic push
1385+
#pragma clang diagnostic ignored "-Wunreachable-code"
1386+
// This _should_ be statically unreachable, but we leave it in as a
1387+
// safeguard in case the control flow above changes.
13841388
swift_unreachable("expected to early return from when handling offer of last task in group");
1389+
#pragma clang diagnostic pop
13851390
}
13861391

13871392
assert(!hadErrorResult && "only successfully completed tasks can reach here");

0 commit comments

Comments
 (0)