[clang] [clang] make __builtin_object_size and __builtin_dynamic_object_size compatible with GCC's constexpr implementation (PR #196377)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 18:51:15 PDT 2026


tbaederr wrote:

> The bytecode interpreter code is interp__builtin_object_size in clang/lib/AST/ByteCode/InterpBuiltin.cpp . For the testcase, just add a RUN line with `-fexperimental-new-constant-interpreter`.

Looks like it's a bit more complex than that, the exact check for `CompoundLiteralExpr` doesn't exist there.  The pointer passed to `evaluateBuiltinObjectSize` is the pointer to `p` and not to the string literal because we ignore the final ltor cast since that's needed to make other tests  work... I'll try to have a closer look on the weekend or next week to see if I can get this to work without causing regressions.

https://github.com/llvm/llvm-project/pull/196377


More information about the cfe-commits mailing list