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

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 18 13:00:59 PDT 2020


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() isn't a great name if it only works on *some* things that have parents.
@rsmith any opinion on what we should do with this one? Would a rename to `getParentRecord()` help much? Something more invasive?

Approving since this is already a bit better and we can fix a crash.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79627/new/

https://reviews.llvm.org/D79627





More information about the cfe-commits mailing list