Page MenuHomePhabricator

Fix IsStructuralMatch specialization for EnumDecl to prevent re-importing an EnumDecl while trying to complete it

Authored by shafik on Mar 26 2019, 2:11 PM.



We may try and re-import an EnumDecl while trying to complete it in IsStructuralMatch(...) specialization for EnumDecl. This change mirrors a similar fix for the specialization for RecordDecl.

Diff Detail

Event Timeline

shafik created this revision.Mar 26 2019, 2:11 PM

LLDB regression test that goes with this fix:

JDevlieghere added inline comments.
if (Decl *ToOrigin = Importer.GetOriginalDecl(ToEnum)) 
  if (auto *ToOriginEnum = dyn_cast<EnumDecl>(ToOrigin))
    ToEnum = ToOriginEnum;
martong accepted this revision.Mar 27 2019, 8:38 AM


This revision is now accepted and ready to land.Mar 27 2019, 8:38 AM
shafik updated this revision to Diff 192466.Mar 27 2019, 9:58 AM

Fixes based on comments.

shafik marked 2 inline comments as done.Mar 27 2019, 9:59 AM
shafik added inline comments.

I normally just match the local style but this is indeed much better style.

This revision was automatically updated to reflect the committed changes.
shafik marked an inline comment as done.
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2019, 10:46 AM

Post-LGTM with some stylish nits.

1950 ↗(On Diff #192475)

completin_g_; also, comments are required to be ended with dot.