[PATCH] Consider only implicit builtin functions as device host in SemaCUDA

Jacques Pienaar jpienaar at google.com
Mon Dec 8 10:50:31 PST 2014


Hi rnk, eliben,

In SemaCUDA all implicit functions were considered device host, this led to errors such as the following code snippet failing to compile:
```
struct Copyable {
  const Copyable& operator=(const Copyable& x) { return *this; }
};

struct Simple {
  Copyable b;
};

void foo() {
  Simple a, b;

  a = b;
}
```
Above the implicit copy assignment operator was inferred as host device but there was only a host assignment copy defined which is an error in device compilation mode.

http://reviews.llvm.org/D6565

Files:
  lib/Sema/SemaCUDA.cpp
  test/SemaCUDA/implicit-copy.cu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6565.17041.patch
Type: text/x-patch
Size: 1174 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141208/7f68310b/attachment.bin>


More information about the cfe-commits mailing list