[cfe-dev] FieldDecl::getParent() not working in Objective C code?

Stephan Bergmann sbergman at redhat.com
Tue Apr 28 09:21:38 PDT 2015


At least on recent trunk, FieldDecl::getParent() does

   return cast<RecordDecl>(getDeclContext());

and I noticed some plugin calling it crashing with a failed assertion

   (isa<X>(Val) && "cast<Ty>() argument of incompatible type!")

when getDeclContext() happened to be an ObjCInterfaceDecl.

Is FieldDecl::getParent() known to only be callable under certain 
circumstances (i.e., the plugin broken), or is something else broken?



More information about the cfe-dev mailing list