[PATCH] D66883: PR42045: Fix diagnosing enqueue_kernel call with too few args

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 03:19:58 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL370322: [OpenCL] Fix diagnosing enqueue_kernel call with too few args (authored by svenvh, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66883?vs=217642&id=217814#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66883/new/

https://reviews.llvm.org/D66883

Files:
  cfe/trunk/lib/Sema/SemaChecking.cpp
  cfe/trunk/test/SemaOpenCL/cl20-device-side-enqueue.cl


Index: cfe/trunk/test/SemaOpenCL/cl20-device-side-enqueue.cl
===================================================================
--- cfe/trunk/test/SemaOpenCL/cl20-device-side-enqueue.cl
+++ cfe/trunk/test/SemaOpenCL/cl20-device-side-enqueue.cl
@@ -158,6 +158,8 @@
   enqueue_kernel(default_queue, flags, ndrange, 1, &event_wait_list, &evt); // expected-error{{illegal call to enqueue_kernel, incorrect argument types}}
 
   enqueue_kernel(default_queue, flags, ndrange, 1, 1); // expected-error{{illegal call to enqueue_kernel, incorrect argument types}}
+
+  enqueue_kernel(default_queue, ndrange, ^{}); // expected-error{{too few arguments to function call, expected at least 4, have 3}}
 }
 
 // Diagnostic tests for get_kernel_work_group_size and allowed block parameter types in dynamic parallelism.
Index: cfe/trunk/lib/Sema/SemaChecking.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp
+++ cfe/trunk/lib/Sema/SemaChecking.cpp
@@ -629,7 +629,9 @@
   unsigned NumArgs = TheCall->getNumArgs();
 
   if (NumArgs < 4) {
-    S.Diag(TheCall->getBeginLoc(), diag::err_typecheck_call_too_few_args);
+    S.Diag(TheCall->getBeginLoc(),
+           diag::err_typecheck_call_too_few_args_at_least)
+        << 0 << 4 << NumArgs;
     return true;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66883.217814.patch
Type: text/x-patch
Size: 1314 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190829/08127f27/attachment.bin>


More information about the cfe-commits mailing list