[PATCH] D57101: [OpenCL] Add generic addr space to the return of implicit assingment

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 29 03:14:36 PST 2019


Anastasia updated this revision to Diff 184052.
Anastasia retitled this revision from "[AST] Fix addr space of result type for dereference operator " to "[OpenCL] Add generic addr space to the return of implicit assingment ".
Anastasia edited the summary of this revision.
Anastasia added a comment.
Herald added a subscriber: yaxunl.

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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57101/new/

https://reviews.llvm.org/D57101

Files:
  lib/Sema/SemaDeclCXX.cpp
  test/CodeGenOpenCLCXX/addrspace-of-this.cl
  test/SemaOpenCLCXX/address_space_overloading.cl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57101.184052.patch
Type: text/x-patch
Size: 20512 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190129/7d744016/attachment-0001.bin>


More information about the cfe-commits mailing list