[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 09:39:59 PDT 2023


jhuber6 added a comment.

In D151087#4361237 <https://reviews.llvm.org/D151087#4361237>, @ebevhan wrote:

> Clang hasn't needed to formalize all of the address space behavior because it's managed to piggyback off of the language semantics provided by OpenCL, and no targets really have had a need for it. Once you start looking at the target AS stuff on its own, you realize it's not really that well defined, and making it even less defined by allowing arbitrary conversions isn't the solution.

I'd rather have an operation whose semantics are a little dangerous than something that doesn't work at all. As it stands we need to use C-style casts for this and I don't think there's a good reason to forbid this at least from the C++ standard point of view. For OpenCL where we have the concept of address spaces it makes sense, but not for C++.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D151087



More information about the cfe-commits mailing list