[PATCH] D48519: [Sema] isValidCoroutineContext FIXME and citations

Gor Nishanov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 23 10:00:45 PDT 2018


GorNishanov accepted this revision.
GorNishanov added a subscriber: rsmith.
GorNishanov added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Sema/SemaCoroutine.cpp:260
   else if (MD && MD->isMoveAssignmentOperator())
     return DiagInvalid(DiagMoveAssign);
+  // [basic.start.main]p3: "The function main shall not be a coroutine."
----------------
modocache wrote:
> @GorNishanov Is there anything in the TS that states copy and move assignment operators shall not include await or yield expressions? These were added D25292 but I'm not sure whether I'm missing something in the TS text, or if maybe this language was in a prior revision of the TS.
Yes. N4499/[special] said:

   A special member function shall not be a coroutine.

I think @rsmith wanted to relax it, but, I am not sure if he had a use case in mind.

I am thinking putting the restriction from N4499 back. 
My approach is if in doubt, be more restrictive initially, then, we can relax if use cases are discovered. It will be a non-breaking change.


Repository:
  rC Clang

https://reviews.llvm.org/D48519





More information about the cfe-commits mailing list