as discussed in [[ https://github.com/bitcoin/bitcoin/issues/17344 | #17344]]
There is a large overlap between this list and Jason Turner's list of recommended compiler diagnostics in the Collaborative Collection of C++ Best Practices (cppbestpractices) project. There is also an overlap with the recommendations given in the C++ Core Guidelines (with editors Bjarne Stroustrup and Herb Sutter).
This is a backport of core#19015