tra accepted this revision. tra added a comment. This revision is now accepted and ready to land.
Small nit. LGTM otherwise. ================ Comment at: lib/Sema/SemaExpr.cpp:11732 @@ +11731,3 @@ + // CUDA device code does not support varargs. + if (getLangOpts().CUDAIsDevice) { + if (const FunctionDecl *F = dyn_cast<FunctionDecl>(CurContext)) { ---------------- tra wrote: > Unneeded {}. Currently CUDAIsDevice does not imply that .CUDA is set. You may end up taking this path if -fcuda-is-device is passed to C++ compilation. For now add .CUDA check. We'll fix CUDA options processing separately. ================ Comment at: lib/Sema/SemaExpr.cpp:11732-11739 @@ +11731,10 @@ + // CUDA device code does not support varargs. + if (getLangOpts().CUDAIsDevice) { + if (const FunctionDecl *F = dyn_cast<FunctionDecl>(CurContext)) { + CUDAFunctionTarget T = IdentifyCUDATarget(F); + if (T == CFT_Global || T == CFT_Device || T == CFT_HostDevice) { + return ExprError(Diag(E->getLocStart(), diag::err_va_arg_in_device)); + } + } + } + ---------------- Unneeded {}. http://reviews.llvm.org/D16331 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits