[PATCH] D146408: [clang][Interp] Start supporting complex types
Timm Bäder via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Mar 28 22:57:42 PDT 2023
tbaeder added inline comments.
================
Comment at: clang/lib/AST/Interp/PrimType.h:108
+ switch (Expr) { \
+ TYPE_SWITCH_CASE(PT_Sint8, B) \
+ TYPE_SWITCH_CASE(PT_Uint8, B) \
----------------
aaron.ballman wrote:
> Oh boy, this is going to be interesting, isn't it?
> ```
> consteval _Complex _BitInt(12) UhOh() { return (_Complex _BitInt(12))1; }
> consteval _Complex _BitInt(18) Why() { return (_Complex _BitInt(18))1; }
>
> static_assert(UhOh() + Why() == 2);
> ```
>
`_BitInt` isn't supported in the new interpreter at all right now, so this just gets rejected.
Apart from that... is a complex bitint really something that should be supported? Not just in the new interpreter but generally?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146408/new/
https://reviews.llvm.org/D146408
More information about the cfe-commits
mailing list