[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.
authorJustin Lebar <jlebar@google.com>
Wed, 12 Oct 2016 01:30:08 +0000 (01:30 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 12 Oct 2016 01:30:08 +0000 (01:30 +0000)
commit0254c46300a1b6143955c5070806f4170911bd5a
tree05324ece206595ab97b283a2f281acf0a59022b0
parentc3dc89e4ab37b93c6934759789f48b062db7f120
[CUDA] Make touching a kernel from a __host__ __device__ function a deferred error.

Previously, this was an immediate, don't pass go, don't collect $200
error.  But this precludes us from writing code like

  __host__ __device__ void launch_kernel() {
    kernel<<<...>>>();
  }

Such code isn't wrong, following our notions of right and wrong in CUDA,
unless it's codegen'ed.

llvm-svn: 283963
clang/lib/Sema/SemaCUDA.cpp
clang/test/SemaCUDA/function-overload-hd.cu [new file with mode: 0644]
clang/test/SemaCUDA/function-overload.cu
clang/test/SemaCUDA/reference-to-kernel-fn.cu