ABataev added inline comments. ================ Comment at: include/clang/AST/Stmt.h:2018-2020 @@ -2016,2 +2017,5 @@ break; + case VCK_ByCopy: + assert(Var && "capturing by copy must have a variable!"); + break; case VCK_VLAType: ---------------- Also add assertion that only pointers anmd scalars are allowed to be captured by value
================ Comment at: lib/CodeGen/CGStmtOpenMP.cpp:139-140 @@ -112,2 +138,4 @@ I = S.captures().begin(); - for (auto *FD : RD->fields()) { + for (auto FI = RD->field_begin(), FE = RD->field_end(); FI != FE; + ++FI, ++Cnt, ++I) { + auto *FD = *FI; ---------------- Turn back to range-based loop ================ Comment at: lib/Sema/SemaOpenMP.cpp:818-819 @@ +817,4 @@ + // captures in that those cases. + IsByRef = isa<TemplateTypeParmType>(Ty) || isa<RecordType>(Ty) || + isa<ArrayType>(Ty); + } ---------------- Wow. I think it is just enough to check !Ty->isScalarType(). http://reviews.llvm.org/D14940 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits