[all-commits] [llvm/llvm-project] 87789e: [CIR] Handle non-zero-initializable types in emitN...
adams381 via All-commits
all-commits at lists.llvm.org
Tue Jun 23 10:47:44 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 87789e236d9de4b8d688a0d7291c7390fc2c58b4
https://github.com/llvm/llvm-project/commit/87789e236d9de4b8d688a0d7291c7390fc2c58b4
Author: adams381 <adams at nvidia.com>
Date: 2026-06-23 (Tue, 23 Jun 2026)
Changed paths:
M clang/lib/CIR/CodeGen/CIRGenFunction.cpp
A clang/test/CIR/CodeGen/member-pointer-null-init.cpp
Log Message:
-----------
[CIR] Handle non-zero-initializable types in emitNullInitialization (#201654)
Value-initializing an aggregate containing a pointer-to-data-member
(e.g. `new Inner()` where `Inner` has an `int Inner::*` field) crashed
with "type is not zero initializable" because `emitNullInitialization`
unconditionally called `errorNYI` for types where `isZeroInitializable`
returns false.
Member pointers use -1 as the null sentinel, so a plain zero store is
incorrect. Replace the `errorNYI` with `emitNullConstant`, which already
builds the correct per-field pattern (-1 for member-pointer fields, zero
elsewhere), and store the result. Types with virtual bases are still
guarded with `errorNYI` since `emitNullConstant` does not yet handle
them.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list