malcolm.parsons added a comment. I found this FIXME comment in `Expr::HasSideEffects()`:
case LambdaExprClass: { const LambdaExpr *LE = cast<LambdaExpr>(this); for (LambdaExpr::capture_iterator I = LE->capture_begin(), E = LE->capture_end(); I != E; ++I) if (I->getCaptureKind() == LCK_ByCopy) // FIXME: Only has a side-effect if the variable is volatile or if // the copy would invoke a non-trivial copy constructor. return true; return false; } It seems a shame not to fix this now, but I don't think I can call Sema code from AST code, and my `CaptureHasSideEffects()` depends on `Sema::getCurrentThisType()`. Any ideas? https://reviews.llvm.org/D30327 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits