When creating the prototype of implicit assignment operators the returned reference to the class should be qualified with the same addr space as 'this' (i.e. __generic in OpenCL).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
What? No, the l-value should still be qualified like the pointee type. An l-value-to-r-value conversion should remove the qualifier, but not just a dereference.
Comment Actions
The original patch was totally wrong. This was simply the problem of incorrectly creating the prototype for implicit assignment. Specifically we missed qualifying the result type with an address space in the declaration while in the definition we were returning *this that was qualified by __generic.
Example - correct prototype of copy assignment operator is:
__generic C &(const __generic C &) __generic noexcept
but we used to create:
C &(const __generic C &) __generic noexcept
forgetting the address space.
I also improved tests to cover this better.