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

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 08:12:34 PDT 2023


arsenm added a comment.

In D151087#4360695 <https://reviews.llvm.org/D151087#4360695>, @jhuber6 wrote:

> I don't think that's something we can diagnose here with just the address space number. it would require information from the underlying target for the expected pointer qualities to the address space.

Yes, this is mandatory. Numbered address spaces are broken and just work by accident and I don't love seeing new code rely on whatever random behavior they have now. Right now they happen to codegen to something that appears to work, while bypassing any kind of sensible semantic checking for what you're doing with them. If you want to really use this, we need to find some way to map numbers back into language address spaces and make them fully aware of the target properties


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