[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 07:14:48 PDT 2023


arsenm added a comment.

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

> In D151087#4360577 <https://reviews.llvm.org/D151087#4360577>, @ebevhan wrote:
>
>> What would be the semantics of such an operation if the address spaces are disjoint? Or, if the underlying pointer widths aren't the same?
>
> It would most likely invalid, but I'm not asserting that `clang` should be responsible for diagnosing misuse in these cases. Especially because in generic freestanding C++ we don't have any language options to suggest the actual semantics.

If the pointer sizes don’t match I think it has to be rejected since it’s no longer a pure bitcast


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