tra added a comment. LGTM in general.
================ Comment at: clang/lib/Sema/SemaExpr.cpp:1944 + // host variable in a device or host device lambda. + auto IsCapturingReferenceToHostVarInCUDADeviceLambda = [&](VarDecl *VD) { + if (!getLangOpts().CUDA || !VD->hasInit()) ---------------- Nit: I'd make it a free function. The large-ish lambda handling a niche case makes the original simple function less readable. I think keeping capture check separate would be a bit cleaner. ================ Comment at: clang/lib/Sema/SemaExpr.cpp:1982 !(getLangOpts().OpenMP && isOpenMPCapturedDecl(D)) && + !IsCapturingReferenceToHostVarInCUDADeviceLambda(VD) && VD->isUsableInConstantExpressions(Context)) ---------------- This could use some Sema tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91088/new/ https://reviews.llvm.org/D91088 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits