refactor: Apply override specifier consistently #18914

pull hebasto wants to merge 2 commits into bitcoin:master from hebasto:200508-override changing 37 files +108 −107
  1. hebasto commented at 11:53 am on May 8, 2020: member

    Two commits are split out from #16710 to make reviewing easier.

    From C++ FAQ:

    C.128: Virtual functions should specify exactly one of virtual, override, or final Reason Readability. Detection of mistakes. Writing explicit virtual, override, or final is self-documenting and enables the compiler to catch mismatch of types and/or names between base and derived classes. However, writing more than one of these three is both redundant and a potential source of errors.

  2. refactor: Use override for non-final overriders 1551cea2d5
  3. refactor: Remove override for final overriders d044e0ec7d
  4. fanquake added the label Refactoring on May 8, 2020
  5. DrahtBot commented at 9:37 pm on May 8, 2020: member

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #18897 (qt: Handle exceptions instead of crash by hebasto)
    • #18789 (qt: Add Create Unsigned button to SendConfirmationDialog by achow101)
    • #16883 (WIP: Qt: add QML based mobile GUI by icota)
    • #16549 (UI external signer support (e.g. hardware wallet) by Sjors)
    • #16546 (External signer support - Wallet Box edition by Sjors)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  6. practicalswift commented at 6:10 am on May 9, 2020: contributor
    ACK d044e0ec7d37bbcdf10bbdb903b9119741c7297d: consistent use of override prevents bugs + patch looks correct + Travis happy
  7. MarcoFalke commented at 11:41 am on May 9, 2020: member
    ACK d044e0ec7d37bbcdf10bbdb903b9119741c7297d, based on my understanding that adding override or final to a function must always be correct, unless it doesn’t compile!?
  8. vasild commented at 4:10 pm on May 11, 2020: member
    ACK d044e0ec7 @MarcoFalke that is my understanding too, except that if override is used when nobody is further overriding a given method then it is better to use final instead of override. This will compile. Even in this case it is better to have override instead of nothing.
  9. sipa commented at 5:28 pm on May 11, 2020: member

    It’s my understanding that changing final/override can never affect semantics, only potentially change whether something compiles or not.

    In addition, override imples virtual, and final implies override, so it should never be needed to specify more than one of these 3.

  10. MarcoFalke merged this on May 11, 2020
  11. MarcoFalke closed this on May 11, 2020

  12. hebasto deleted the branch on May 11, 2020
  13. Fabcien referenced this in commit 4770199b7a on Jan 28, 2021
  14. kittywhiskers referenced this in commit d5cd55e958 on Jun 16, 2021
  15. kittywhiskers referenced this in commit 0b3095a688 on Jun 17, 2021
  16. kittywhiskers referenced this in commit 73f9fcb7e2 on Jun 17, 2021
  17. UdjinM6 referenced this in commit 988fa6a235 on Jun 23, 2021
  18. DrahtBot locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-17 12:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me