pfultz2 added a comment. > Not only the capture is an issue, like a regular function, lambda could also > access non-local variables/functions.
In practice this is not an issue. Hcc will implictly treat anything inlinable as host device, and user's are not confused or surprised when they use non-local variables/reference that are on the host. > From the other perspective, a lambda is just another function and should have > consistent rule for its usage, resolution, and etc. But its not like another function. It has internal linkage(even when using global variables declared with `inline`). Lambdas are also implicitly `constexpr` whereas a function need to explicitly declare `constexpr`. Making lambdas implicitly HD whereas function need to be explicit seems to be consistent with how lambdas work with `constexpr`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits