ccotter added a comment.

Passing and accessing a reference is safe if the access is done before any 
suspend point (taking into account whether the initial coroutine suspend 
actually suspends or not). Although CP.53 recommends warning on any reference 
parameter regardless of whether the code only accesses the reference before any 
suspend points, I did implement (not in this changeset - in a separate branch) 
a version of this check that uses the CFG to determine whether reference 
parameters are never accessed after a suspend point. If there's interest, I 
could reimplement this check with this (perhaps as a tool option). That said, I 
do agree with CP.53 that relying on such access being safe is brittle e.g. if 
the code is refactored in the future to rearrange suspend points, so I went 
with this approach for the review.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140793/new/

https://reviews.llvm.org/D140793

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to