[clang] Mark an ObjCIvarDecl as invalid if its type contains errors (PR #68001)

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 18:22:15 PDT 2023


ahatanak wrote:

The commit fixed an assertion that was failing in SemaInit.cpp. 

Assertion failed: (Kind.getKind() == InitializationKind::IK_Copy || Kind.isExplicitCast() || Kind.getKind() == InitializationKind::IK_DirectList), function Perform, file SemaInit.cpp, line 8607.

The assertion in `InitializationSequence::Perform` was failing because an ivar that had an invalid type wasn't marked as invalid (`ivar0[Count]` in the test case). `Sema::SetIvarInitializers`, which calls `InitializationSequence::Perform` to initialize ivars, should have skipped the invalid ivar, but it wasn't because the ivar wasn't marked as invalid.

There's no github issue for this fix.

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


More information about the cfe-commits mailing list