This is an archive of the discontinued LLVM Phabricator instance.

[coroutines] Diagnose when 'main' is declared as a coroutine.
ClosedPublic

Authored by EricWF on Sep 30 2016, 1:26 AM.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 73003.Sep 30 2016, 1:26 AM
EricWF retitled this revision from to [Coroutines] Diagnose when 'main' is declared as a coroutine..
EricWF updated this object.
EricWF added reviewers: rsmith, GorNishanov.
EricWF added a subscriber: cfe-commits.
GorNishanov added inline comments.Sep 30 2016, 8:39 AM
include/clang/Basic/DiagnosticSemaKinds.td
8569

I am wondering, if we can handle all four cases when function can be a coroutine.

co_await
co_yield
co_return
for co_await

future<int> f() { co_return 42; } // is a valid coroutine per P0057R5

GorNishanov retitled this revision from [Coroutines] Diagnose when 'main' is declared as a coroutine. to [coroutines] Diagnose when 'main' is declared as a coroutine..Sep 30 2016, 8:40 AM
rsmith edited edge metadata.Sep 30 2016, 10:00 AM

LGTM, go ahead when Gor is happy.

GorNishanov edited edge metadata.Sep 30 2016, 10:39 AM

LGTM

I am happy either way. Fixes for co_return can come later.

GorNishanov accepted this revision.Sep 30 2016, 10:39 AM
GorNishanov edited edge metadata.
This revision is now accepted and ready to land.Sep 30 2016, 10:39 AM
EricWF closed this revision.Sep 30 2016, 3:47 PM