ahatanak added a comment.

The original comment said "call sized device delete even though host has 
preferable non-sized version", but it seems that the non-sized host version 
'T::operator delete(void*)' is being called in the IR, not the sized device 
version of delete. Is that a bug in overload resolution?
This is the command I used:

"clang -cc1 -internal-isystem --std=c++11 -triple nvptx-unknown-unknown 
-fcuda-is-device    -emit-llvm -o  - test.cu"

$ cat test.cu

  #define __constant__ __attribute__((constant))
  #define __device__ __attribute__((device))
  #define __host__ __attribute__((host))
  
  typedef __SIZE_TYPE__ size_t;
  
  struct T {
    __host__ void operator delete(void*);
    __device__ void operator delete(void*, size_t);
  };
  
  __host__ __device__ void class_specific_delete(T *t) {
    delete t;
  }


Repository:
  rC Clang

https://reviews.llvm.org/D47757



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to