[PATCH] D71111: [Sema] Improve diagnostic about addr spaces for overload candidates

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 8 00:26:49 PST 2019


rjmccall added a comment.

Hmm.  How about:

  // For the `this` argument
  candidate function not viable: 'this' object is in '__private' address space, but method expects object in '__global' address space
  
  // For pointer arguments
  candidate function not viable: cannot pass pointer to '__private' address space as a pointer to '__global' address space in 1st argument
  
  // For reference arguments
  candidate function not viable: cannot bind reference in '__global' address space to object in '__private' address space in 1st argument

This would require you to render a string describing the address space yourself.  I would suggest "generic address space" for the default AS outside of OpenCL, "'foo' address space" for a language-specific AS (including implicit __private in OpenCL), or "address space N" for a numbered address space.

What do you think?


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

https://reviews.llvm.org/D71111





More information about the cfe-commits mailing list