OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0) apart from some exceptions:
- printf
- enqueue_kernel
This change adds error diagnostic for variadic functions but accepts printf and any compiler internal function (which should cover __enqueue_kernel_XXX cases). It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks.
Note that this implementation checks against printf name. Alternative approach would be to enable printf as Clang builtin and diagnose using custom Sema checks. Though it 's not clear whether this brings any benefit.