[clang] [clang][bytecode] Support different integral types (e.g. addresses) (PR #169769)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 4 06:15:43 PST 2026
tbaederr wrote:
`test/Sema/init.c` has this test:
```c
typedef void (* fp)(void);
void foo(void);
fp a[(short int)1] = { foo };
__UINTPTR_TYPE__ ptrasintadd2 = (__UINTPTR_TYPE__)&a + 4;
```
where the initializer (`(__UINTPTR_TYPE__)&a + 4`) goes through `evaluatAsRValue()`, and needs to succeed. That means an address integral can't _just_ be an address, it needs to be an address and an offset. To make this worse, arithmetic on that result needs to work as well, i.e.`( (__UINTPTR_TYPE__)&a + 4) + 10` also needs to work and return the correct lvalue offset of 14.
https://github.com/llvm/llvm-project/pull/169769
More information about the cfe-commits
mailing list