[PATCH] D16484: [CUDA] Disallow variadic functions other than printf in device code.
Justin Lebar via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 22 13:40:25 PST 2016
jlebar added inline comments.
================
Comment at: lib/Sema/SemaDecl.cpp:8291-8293
@@ +8290,5 @@
+ // in device-side CUDA code.
+ if (NewFD->isVariadic() && (NewFD->hasAttr<CUDADeviceAttr>() ||
+ NewFD->hasAttr<CUDAGlobalAttr>()) &&
+ !(II && II->isStr("printf") && !D.isFunctionDefinition())) {
+ Diag(NewFD->getLocation(), diag::err_variadic_device_fn);
----------------
tra wrote:
> It would be nice to emit this diagnostics on one side of compilation only.
>
> Nit - unneeded {}
Resolved irl.
http://reviews.llvm.org/D16484
More information about the cfe-commits
mailing list