This is an archive of the discontinued LLVM Phabricator instance.

[Clang] Fix lambda CheckForDefaultedFunction(...) so that it checks the CXXMethodDecl is not deleted before attempting to call DefineDefaultedFunction(...)
ClosedPublic

Authored by shafik on Sep 1 2022, 6:52 PM.

Details

Summary

I discovered this additional bug at the end of working on D132906

In Sema::CheckCompletedCXXClass(...) uses a lambda CheckForDefaultedFunction to verify each CXXMethodDecl holds to the expected invariants before passing them on to CheckForDefaultedFunction.

It is currently missing a check that it is not deleted, this adds that check and a test that crashed without this check.

This fixes: https://github.com/llvm/llvm-project/issues/57516

Diff Detail

Event Timeline

shafik created this revision.Sep 1 2022, 6:52 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 1 2022, 6:52 PM
shafik requested review of this revision.Sep 1 2022, 6:52 PM
erichkeane accepted this revision.Sep 2 2022, 6:10 AM
This revision is now accepted and ready to land.Sep 2 2022, 6:10 AM
shafik updated this revision to Diff 457736.Sep 2 2022, 5:34 PM
  • Add Release note.
This revision was landed with ongoing or failed builds.Sep 2 2022, 7:05 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 2 2022, 7:05 PM