[PATCH] D58346: [Sema] Change addr space diagnostics in casts to follow C++ style

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 21 12:43:09 PDT 2023


jhuber6 added a comment.
Herald added a subscriber: arichardson.
Herald added a project: All.

Ran into this change trying to decay a qualifier pointer to a generic address space, e.g. https://godbolt.org/z/3dEd4TxjW. I understand that `addrspace_cast` was added to replace this functionality, but this isn't a C++ feature so as it stands there's no way to perform this operation in C++ and we need to rely on C-style casts to perform this basic functionality. I see it was brought up earlier, but should C++ really be limited by OpenCL here? I'm not aware of any specific mention of these, `reinterpret_cast` only explicitly disallows `volatile` and `const` qualifiers as far as I'm aware. The remaining case can be thought of as a compiler extension as `[[clang::address_space(n)]]` has no meaning otherwise.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58346



More information about the cfe-commits mailing list