[PATCH] D79627: [AST] Fix an assertion violation in FieldDecl::getParent.

2020-05-19 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfcf0764998b4: [AST] Fix an assertion violation in FieldDecl::getParent. (authored by hokein). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79627/new/ https

[PATCH] D79627: [AST] Fix an assertion violation in FieldDecl::getParent.

2020-05-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a subscriber: rsmith. sammccall added a comment. This revision is now accepted and ready to land. Sorry for stalling this. This is a sad situation, the API is actively misleading about the invariants. Even the new API isn't very safe: getParent()

[PATCH] D79627: [AST] Fix an assertion violation in FieldDecl::getParent.

2020-05-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous. Herald added a project: clang. FieldDecl::getParent assumes that the FiledDecl::getDeclContext returns a RecordDecl, this is true for C/C++, but not for ObjCIvarDecl: