[OpenCL] Reject block arguments
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 29 Jun 2020 13:13:12 +0000 (14:13 +0100)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Mon, 29 Jun 2020 13:13:12 +0000 (14:13 +0100)
commitbd46a56474d3b27a4fb520503d5714e23097d495
tree563269db19e622e17365a6e95895e26569db915f
parentb7ca06b74505fb2daaee746403cc9ee3b78ac1d0
[OpenCL] Reject block arguments

OpenCL 2.0 does not allow block arguments, primarily because it is
difficult to support function pointers on the various architectures
that OpenCL targets.  Clang was still accepting them.

Rename and reuse the `err_opencl_half_param` diagnostic.

Fixes PR46324.

Differential Revision: https://reviews.llvm.org/D82313
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaType.cpp
clang/test/CodeGenOpenCL/blocks.cl
clang/test/Frontend/opencl.cl
clang/test/SemaOpenCL/invalid-block.cl