[SERVER-48075] class with destructor marked 'final' cannot be inherited from Created: 11/May/20  Updated: 27/Oct/23  Resolved: 14/Dec/22

Status: Closed
Project: Core Server
Component/s: Security
Affects Version/s: 4.4.0-rc5
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Jiang Li Assignee: Alex Neben
Resolution: Works as Designed Votes: 0
Labels: post-v4-toolchain
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Development Platform
Participants:

 Description   

src/mongo/db/free_mon/free_mon_mongod.cpp:98:27: error: class with destructor marked 'final' cannot be inherited from [-Werror,-Wfinal-dtor-non-final-class]
 ~FreeMonNetworkHttp() final = default;
 ^
 src/mongo/db/free_mon/free_mon_mongod.cpp:87:7: note: mark 'mongo::(anonymous namespace)::FreeMonNetworkHttp' as 'final' to silence this warning
 class FreeMonNetworkHttp : public FreeMonNetworkInterface {
 ^
 1 error generated.



 Comments   
Comment by Alex Neben [ 14/Dec/22 ]

This warning is good. I would like to keep this warning enabled. Please reopen if you feel otherwise.

Comment by Andrew Morrow (Inactive) [ 18/May/20 ]

liangjie.mailbox@qq.com -

Thank you for filing this ticket, along with SERVER-48076, SERVER-48077, and SERVER-48079. My comments here apply to all four.

  • First, MongoDB's CI system builds with a specific version of clang for each stable branch. In the case of MongoDB v4.4, that is clang-7. We do not guarantee that the build works with older compilers, nor do we guarantee that the build does not produce novel warnings when using newer compilers, or even work at all. Doing so would require a massive expansion of our build and test matrix.
  • Second, these warnings are becoming errors because we build with -Werror. If these warnings, as escalated to errors, are preventing you from building the tree, you can add the flag --disable-warnings-as-errors to your SCons invocation. The warnings will still happen but they won't become errors. However, our recommendation would be that you build the tree from source with clang-7, if possible, as this is our validated compiler version for the MongoDB v4.2 and v4.4 branches.
  • Third, since it is possible that these warnings are identifying bugs, I am going to route the tickets as appropriate to the teams responsible for the underlying code for them to evaluate. So it is possible that some of them may get fixed. In other cases, the warning may be determined to be harmless or spurious, in which case the issue is likely to be queued on the backlog.
  • Fourth, I will enqueue these tickets into our work queue for our next compiler upgrade, so that when we do move to clang 10 we remember to address any of these that were not otherwise fixed.

Please let me know if you have any questions or concerns on the above items.

Generated at Thu Feb 08 05:16:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.