FieldDecl::getParent assumes that the FiledDecl::getDeclContext returns a
RecordDecl, this is true for C/C++, but not for ObjCIvarDecl:
The Decls hierarchy is like following
FieldDecl <-- ObjCIvarDecl
DeclContext <-- ObjCContainerDecl <-- ObjCInterfaceDecl
^ |----- TagDecl <-- RecordDecl
calling getParent() on ObjCIvarDecl will:
- invoke getDeclContext(), which returns a DeclContext*, which points to an ObjCInterfaceDecl;
- then downcast the "DeclContext" pointer to a RecordDecl*, and we will hit
the "is_a<RecordDecl>" assertion in llvm::cast (undefined behavior
in release build without assertion enabled);