Skip to content

style: use = default for empty destructors#159

Closed
TingleDinkle wants to merge 1 commit intozeldaret:masterfrom
TingleDinkle:cleanup/default-dtors-include-style
Closed

style: use = default for empty destructors#159
TingleDinkle wants to merge 1 commit intozeldaret:masterfrom
TingleDinkle:cleanup/default-dtors-include-style

Conversation

@TingleDinkle
Copy link
Contributor

@TingleDinkle TingleDinkle commented Feb 15, 2026

Small style cleanup — use = default for empty destructors in matching code.

Changes

  • mapObjectLink.h: ~ObjectLink() {} → = default
  • actBaseProcJob.h: ~BaseProcJobLists() { ; } → = default

This change is Reviewable

@leoetlino
Copy link
Collaborator

~BaseProcJobLists() { ; } and ~BaseProcJobLists() {} are not equivalent - the former inhibits some optimisations because older versions of Clang checked whether the destructor function body was literally empty instead of checking if the body was functionally empty

The mapObjectLink change should be semantically equivalent but unfortunately that appears to change codegen

@TingleDinkle
Copy link
Contributor Author

~BaseProcJobLists() { ; } and ~BaseProcJobLists() {} are not equivalent - the former inhibits some optimisations because older versions of Clang checked whether the destructor function body was literally empty instead of checking if the body was functionally empty

The mapObjectLink change should be semantically equivalent but unfortunately that appears to change codegen

Fascinating, I didn't realize the older Clang compiler was that literal about the stray semicolon in { ; }! Thanks for explaining the codegen shift, it makes total sense now. I was wondering since yesterday about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants