Repository: randombit/botan
Pull request #3462 (2023-04-01 15:50:07)

Disable MSVC warnings about inheritance via dominance
I use the amalgamation build and the warnings below appear with MSVC 2022. I generally aim to build with warnings as errors where possible.

I tried fixing these with the "using" keyword but to no avail.

This PR defines a new macro BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE and places it around the classes in question.

This warning only appears with MSVC, so the macro is empty for the other platforms.

It also renames BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED to BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS to make its meaning clearer and consistent in length with the new added macro.

```
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): error C2220: the following warning is treated as an error (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7297,19): message : see declaration of 'Botan::Curve25519_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7299,14): message : see declaration of 'Botan::Curve25519_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7311,12): message : see declaration of 'Botan::Curve25519_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7301,14): message : see declaration of 'Botan::Curve25519_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7305,27): message : see declaration of 'Botan::Curve25519_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7392,4): warning C4250: 'Botan::Curve25519_PrivateKey': inherits 'Botan::Curve25519_PublicKey::Botan::Curve25519_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(7307,28): message : see declaration of 'Botan::Curve25519_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8013,19): message : see declaration of 'Botan::DH_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8008,14): message : see declaration of 'Botan::DH_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8017,12): message : see declaration of 'Botan::DH_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8009,14): message : see declaration of 'Botan::DH_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::check_key' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8006,12): message : see declaration of 'Botan::DH_PublicKey::check_key' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8003,27): message : see declaration of 'Botan::DH_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8086,4): warning C4250: 'Botan::DH_PrivateKey': inherits 'Botan::DH_PublicKey::Botan::DH_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(8004,28): message : see declaration of 'Botan::DH_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9421,4): warning C4250: 'Botan::EC_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9334,14): message : see declaration of 'Botan::EC_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9421,4): warning C4250: 'Botan::EC_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9333,14): message : see declaration of 'Botan::EC_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9421,4): warning C4250: 'Botan::EC_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::check_key' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9289,12): message : see declaration of 'Botan::EC_PublicKey::check_key' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9421,4): warning C4250: 'Botan::EC_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9285,27): message : see declaration of 'Botan::EC_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9421,4): warning C4250: 'Botan::EC_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9287,28): message : see declaration of 'Botan::EC_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::ECDH_PublicKey::Botan::ECDH_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9457,19): message : see declaration of 'Botan::ECDH_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9334,14): message : see declaration of 'Botan::EC_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PrivateKey::Botan::EC_PrivateKey::get_int_field' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9389,21): message : see declaration of 'Botan::EC_PrivateKey::get_int_field' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::ECDH_PublicKey::Botan::ECDH_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9471,12): message : see declaration of 'Botan::ECDH_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9333,14): message : see declaration of 'Botan::EC_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::check_key' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9289,12): message : see declaration of 'Botan::EC_PublicKey::check_key' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9285,27): message : see declaration of 'Botan::EC_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PublicKey::Botan::EC_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9287,28): message : see declaration of 'Botan::EC_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PrivateKey::Botan::EC_PrivateKey::private_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9375,30): message : see declaration of 'Botan::EC_PrivateKey::private_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9525,4): warning C4250: 'Botan::ECDH_PrivateKey': inherits 'Botan::EC_PrivateKey::Botan::EC_PrivateKey::raw_private_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9377,30): message : see declaration of 'Botan::EC_PrivateKey::raw_private_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9577,19): message : see declaration of 'Botan::ECDSA_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::EC_PrivateKey::Botan::EC_PrivateKey::get_int_field' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9389,21): message : see declaration of 'Botan::EC_PrivateKey::get_int_field' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9584,12): message : see declaration of 'Botan::ECDSA_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::message_parts' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9579,14): message : see declaration of 'Botan::ECDSA_PublicKey::message_parts' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::message_part_size' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9581,14): message : see declaration of 'Botan::ECDSA_PublicKey::message_part_size' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::create_verification_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9594,10): message : see declaration of 'Botan::ECDSA_PublicKey::create_verification_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9644,4): warning C4250: 'Botan::ECDSA_PrivateKey': inherits 'Botan::ECDSA_PublicKey::Botan::ECDSA_PublicKey::create_x509_verification_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9598,10): message : see declaration of 'Botan::ECDSA_PublicKey::create_x509_verification_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9655,19): message : see declaration of 'Botan::Ed25519_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9657,14): message : see declaration of 'Botan::Ed25519_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9667,12): message : see declaration of 'Botan::Ed25519_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9659,14): message : see declaration of 'Botan::Ed25519_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9663,27): message : see declaration of 'Botan::Ed25519_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9665,28): message : see declaration of 'Botan::Ed25519_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::create_verification_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9689,10): message : see declaration of 'Botan::Ed25519_PublicKey::create_verification_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9745,4): warning C4250: 'Botan::Ed25519_PrivateKey': inherits 'Botan::Ed25519_PublicKey::Botan::Ed25519_PublicKey::create_x509_verification_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(9693,10): message : see declaration of 'Botan::Ed25519_PublicKey::create_x509_verification_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::algo_name' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16014,19): message : see declaration of 'Botan::RSA_PublicKey::algo_name' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::estimated_strength' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16033,14): message : see declaration of 'Botan::RSA_PublicKey::estimated_strength' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::supports_operation' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16037,12): message : see declaration of 'Botan::RSA_PublicKey::supports_operation' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::key_length' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16032,14): message : see declaration of 'Botan::RSA_PublicKey::key_length' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::algorithm_identifier' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16018,27): message : see declaration of 'Botan::RSA_PublicKey::algorithm_identifier' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::public_key_bits' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16020,28): message : see declaration of 'Botan::RSA_PublicKey::public_key_bits' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::create_encryption_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16043,10): message : see declaration of 'Botan::RSA_PublicKey::create_encryption_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::create_kem_encryption_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16048,10): message : see declaration of 'Botan::RSA_PublicKey::create_kem_encryption_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::create_verification_op' via dominance (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16052,10): message : see declaration of 'Botan::RSA_PublicKey::create_verification_op' (compiling source file crypto_utils.cpp)
1>C:\Users\Oliver\Git\source\ovlibs\ovcore\thirdparty\botan\windows\x64\botan_all.h(16162,4): warning C4250: 'Botan::RSA_PrivateKey': inherits 'Botan::RSA_PublicKey::Botan::RSA_PublicKey::create_x509_verification_op' via dominance (compiling source file crypto_utils.cpp)
```

codecov-commenter: ## [Codecov](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd) Report
Patch coverage: **`100.00`**% and project coverage change: **`-0.01`** :warning:
> Comparison is base [(`ac2c910`)](https://codecov.io/gh/randombit/botan/commit/ac2c91029ef5f8e25d8b376021946486f78f0503?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd) 88.23% compared to head [(`0afdc92`)](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd) 88.23%.

:mega: This organization is not using Codecov’s [GitHub App Integration](https://github.com/apps/codecov). We recommend you install it so Codecov can continue to function properly for your repositories. [Learn more](https://about.codecov.io/blog/codecov-is-updating-its-github-integration/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd)

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3462      +/-   ##
==========================================
- Coverage   88.23%   88.23%   -0.01%     
==========================================
  Files         618      618              
  Lines       70356    70358       +2     
  Branches     6874     6875       +1     
==========================================
- Hits        62078    62077       -1     
- Misses       5420     5424       +4     
+ Partials     2858     2857       -1     
```


| [Impacted Files](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd) | Coverage Δ | |
|---|---|---|
| [src/cli/sandbox.cpp](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd#diff-c3JjL2NsaS9zYW5kYm94LmNwcA==) | `100.00% <ø> (ø)` | |
| [src/lib/misc/cryptobox/cryptobox.cpp](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd#diff-c3JjL2xpYi9taXNjL2NyeXB0b2JveC9jcnlwdG9ib3guY3Bw) | `92.95% <ø> (ø)` | |
| [src/tests/test\_cryptobox.cpp](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd#diff-c3JjL3Rlc3RzL3Rlc3RfY3J5cHRvYm94LmNwcA==) | `88.00% <100.00%> (ø)` | |

... and [9 files with indirect coverage changes](https://codecov.io/gh/randombit/botan/pull/3462/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd)

Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd)

</details>

[:umbrella: View full report in Codecov by Sentry](https://codecov.io/gh/randombit/botan/pull/3462?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd).   
:loudspeaker: Do you have feedback about the report comment? [Let us know in this issue](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Jack+Lloyd).

lieser: If we start "fixing" this (by suppressing the warning in the places it currently occurs), it probably makes sense to remove the disabling of the warning in the msvc compiler options.
oviano: Yes of course you are right, I should have taken this approach.

Will update.
oviano: > If we start "fixing" this (by suppressing the warning in the places it currently occurs), it probably makes sense to remove the disabling of the warning in the msvc compiler options.

Actually, pardon my ignorance but where do you propose this pragma warning disable goes?

It can't go in compiler.h as that is included as a public header so would disable the code in any other non-Botan code that ended up including it, such as botan_all.h in the amalgamation build.

Is there another file I've missed that will limit the scope of this to botan only?
lieser: > Actually, pardon my ignorance but where do you propose this pragma warning disable goes?

I think you misunderstood me.
Currently the msvc compiler warning flags for building botan itself contains `/wd4250`, which disables the C4250 warning for the build of botan. See https://github.com/randombit/botan/blob/015c0c2b3d70fbef54955ea6f308d765f73a4e5d/src/build-data/cc/msvc.txt#L34

As your change now suppresses the warning locally, this should no longer be needed.
And removing the global disabling would prevent new code being introduced that would again contain the warning.
oviano: > > Actually, pardon my ignorance but where do you propose this pragma warning disable goes?
> 
> I think you misunderstood me. Currently the msvc compiler warning flags for building botan itself contains `/wd4250`, which disables the C4250 warning for the build of botan. See
> 
> https://github.com/randombit/botan/blob/015c0c2b3d70fbef54955ea6f308d765f73a4e5d/src/build-data/cc/msvc.txt#L34
> 
> As your change now suppresses the warning locally, this should no longer be needed. And removing the global disabling would prevent new code being introduced that would again contain the warning.

Sorry yes, I'm with you now.

Since I was only building a subset of Botan (via the amalgamation) I was only seeing a subset of these warnings so I temporarily enabled all modules and worked through to remove them all, and finally took out the entry in msvc.txt.

Patch:
diff --git a/src/build-data/cc/msvc.txt b/src/build-data/cc/msvc.txt
index 49057efcc..6124a143b 100644
--- a/src/build-data/cc/msvc.txt
+++ b/src/build-data/cc/msvc.txt
@@ -27,11 +27,10 @@ preproc_flags "/nologo /EP"
 
 lang_flags "/std:c++20 /EHs /GR"
 
-# 4250: diamond inheritence warning
 # 4251: STL types used in DLL interface
 # 4275: ???
 # 5072: ASan without debug info
-warning_flags "/W4 /wd4250 /wd4251 /wd4275 /wd5072"
+warning_flags "/W4 /wd4251 /wd4275 /wd5072"
 
 werror_flags "/WX"
 
diff --git a/src/cli/sandbox.cpp b/src/cli/sandbox.cpp
index 1c1ab21c3..d448aa23d 100644
--- a/src/cli/sandbox.cpp
+++ b/src/cli/sandbox.cpp
@@ -111,7 +111,7 @@ bool Sandbox::init()
 #elif defined(BOTAN_TARGET_OS_HAS_SANDBOX_PROC)
 
   BOTAN_DIAGNOSTIC_PUSH
-  BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
+  BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
    if (::sandbox_init(kSBXProfileNoWriteExceptTemporary, SANDBOX_NAMED, nullptr) < 0)
    {
        return false;
diff --git a/src/lib/misc/cryptobox/cryptobox.cpp b/src/lib/misc/cryptobox/cryptobox.cpp
index a6080b620..46803775b 100644
--- a/src/lib/misc/cryptobox/cryptobox.cpp
+++ b/src/lib/misc/cryptobox/cryptobox.cpp
@@ -153,7 +153,7 @@ decrypt_bin(const uint8_t input[], size_t input_len,
    }
 
 BOTAN_DIAGNOSTIC_PUSH
-BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
+BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
 
 secure_vector<uint8_t> decrypt_bin(const std::string& input,
                                    const std::string& passphrase)
diff --git a/src/lib/prov/pkcs11/p11_ecdh.h b/src/lib/prov/pkcs11/p11_ecdh.h
index f659f3dff..182e27beb 100644
--- a/src/lib/prov/pkcs11/p11_ecdh.h
+++ b/src/lib/prov/pkcs11/p11_ecdh.h
@@ -60,6 +60,10 @@ class BOTAN_PUBLIC_API(2,0) PKCS11_ECDH_PublicKey : public PKCS11_EC_PublicKey
    };
 
 /// Represents a PKCS#11 ECDH private key
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) PKCS11_ECDH_PrivateKey final : public virtual PKCS11_EC_PrivateKey, public virtual PK_Key_Agreement_Key
    {
    public:
@@ -121,6 +125,8 @@ class BOTAN_PUBLIC_API(2,0) PKCS11_ECDH_PrivateKey final : public virtual PKCS11
                                  std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 using PKCS11_ECDH_KeyPair = std::pair<PKCS11_ECDH_PublicKey, PKCS11_ECDH_PrivateKey>;
 
 /**
diff --git a/src/lib/prov/pkcs11/p11_ecdsa.h b/src/lib/prov/pkcs11/p11_ecdsa.h
index 31b11089c..b52eefc71 100644
--- a/src/lib/prov/pkcs11/p11_ecdsa.h
+++ b/src/lib/prov/pkcs11/p11_ecdsa.h
@@ -24,6 +24,10 @@ namespace PKCS11 {
 class Session;
 
 /// Represents a PKCS#11 ECDSA public key
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) PKCS11_ECDSA_PublicKey final : public PKCS11_EC_PublicKey, public virtual ECDSA_PublicKey
    {
    public:
@@ -58,6 +62,8 @@ class BOTAN_PUBLIC_API(2,0) PKCS11_ECDSA_PublicKey final : public PKCS11_EC_Publ
                                 std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 /// Represents a PKCS#11 ECDSA private key
 class BOTAN_PUBLIC_API(2,0) PKCS11_ECDSA_PrivateKey final : public PKCS11_EC_PrivateKey
    {
diff --git a/src/lib/prov/pkcs11/p11_rsa.h b/src/lib/prov/pkcs11/p11_rsa.h
index 2d34d174e..a15305fac 100644
--- a/src/lib/prov/pkcs11/p11_rsa.h
+++ b/src/lib/prov/pkcs11/p11_rsa.h
@@ -170,6 +170,10 @@ class BOTAN_PUBLIC_API(2,0) RSA_PrivateKeyGenerationProperties final : public Pr
    };
 
 /// Represents a PKCS#11 RSA private key
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) PKCS11_RSA_PrivateKey final :
    public Object, public Private_Key, public RSA_PublicKey
    {
@@ -226,6 +230,8 @@ class BOTAN_PUBLIC_API(2,0) PKCS11_RSA_PrivateKey final :
       bool m_use_software_padding = false;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 using PKCS11_RSA_KeyPair = std::pair<PKCS11_RSA_PublicKey, PKCS11_RSA_PrivateKey>;
 
 /**
diff --git a/src/lib/pubkey/curve25519/curve25519.h b/src/lib/pubkey/curve25519/curve25519.h
index 35d698230..513260641 100644
--- a/src/lib/pubkey/curve25519/curve25519.h
+++ b/src/lib/pubkey/curve25519/curve25519.h
@@ -60,6 +60,9 @@ class BOTAN_PUBLIC_API(2,0) Curve25519_PublicKey : public virtual Public_Key
       std::vector<uint8_t> m_public;
    };
 
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) Curve25519_PrivateKey final : public Curve25519_PublicKey,
                                         public virtual Private_Key,
                                         public virtual PK_Key_Agreement_Key
@@ -109,6 +112,8 @@ class BOTAN_PUBLIC_API(2,0) Curve25519_PrivateKey final : public Curve25519_Publ
       secure_vector<uint8_t> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 typedef Curve25519_PublicKey X25519_PublicKey;
 typedef Curve25519_PrivateKey X25519_PrivateKey;
 
diff --git a/src/lib/pubkey/dh/dh.h b/src/lib/pubkey/dh/dh.h
index ee3330dc6..8de162711 100644
--- a/src/lib/pubkey/dh/dh.h
+++ b/src/lib/pubkey/dh/dh.h
@@ -71,6 +71,10 @@ class BOTAN_PUBLIC_API(2,0) DH_PublicKey : public virtual Public_Key
 /**
 * This class represents Diffie-Hellman private keys.
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) DH_PrivateKey final :
    public DH_PublicKey,
    public PK_Key_Agreement_Key,
@@ -120,6 +124,8 @@ class BOTAN_PUBLIC_API(2,0) DH_PrivateKey final :
       std::shared_ptr<const DL_PrivateKey> m_private_key;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/dilithium/dilithium_common/dilithium.h b/src/lib/pubkey/dilithium/dilithium_common/dilithium.h
index 3266a0b30..9e9e46038 100644
--- a/src/lib/pubkey/dilithium/dilithium_common/dilithium.h
+++ b/src/lib/pubkey/dilithium/dilithium_common/dilithium.h
@@ -103,6 +103,9 @@ class BOTAN_PUBLIC_API(3, 0) Dilithium_PublicKey : public virtual Public_Key
       std::shared_ptr<Dilithium_PublicKeyInternal> m_public;
    };
 
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(3, 0) Dilithium_PrivateKey final : public virtual Dilithium_PublicKey,
    public virtual Botan::Private_Key
    {
@@ -142,6 +145,8 @@ class BOTAN_PUBLIC_API(3, 0) Dilithium_PrivateKey final : public virtual Dilithi
       std::shared_ptr<Dilithium_PrivateKeyInternal> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 } // namespace Botan
 
 #endif
diff --git a/src/lib/pubkey/dsa/dsa.h b/src/lib/pubkey/dsa/dsa.h
index 41ce5b23c..de5440978 100644
--- a/src/lib/pubkey/dsa/dsa.h
+++ b/src/lib/pubkey/dsa/dsa.h
@@ -80,6 +80,10 @@ class BOTAN_PUBLIC_API(2,0) DSA_PublicKey : public virtual Public_Key
 /**
 * DSA Private Key
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) DSA_PrivateKey final :
    public DSA_PublicKey,
    public virtual Private_Key
@@ -126,6 +130,8 @@ class BOTAN_PUBLIC_API(2,0) DSA_PrivateKey final :
       std::shared_ptr<const DL_PrivateKey> m_private_key;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ecc_key/ecc_key.h b/src/lib/pubkey/ecc_key/ecc_key.h
index d922d008e..ba0c3a4bb 100644
--- a/src/lib/pubkey/ecc_key/ecc_key.h
+++ b/src/lib/pubkey/ecc_key/ecc_key.h
@@ -122,6 +122,10 @@ class BOTAN_PUBLIC_API(2,0) EC_PublicKey : public virtual Public_Key
 /**
 * This abstract class represents ECC private keys
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) EC_PrivateKey : public virtual EC_PublicKey,
                                 public virtual Private_Key
    {
@@ -174,6 +178,8 @@ class BOTAN_PUBLIC_API(2,0) EC_PrivateKey : public virtual EC_PublicKey,
       BigInt m_private_key;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ecdh/ecdh.h b/src/lib/pubkey/ecdh/ecdh.h
index 13ee0b386..27fdcb2d3 100644
--- a/src/lib/pubkey/ecdh/ecdh.h
+++ b/src/lib/pubkey/ecdh/ecdh.h
@@ -68,6 +68,10 @@ class BOTAN_PUBLIC_API(2,0) ECDH_PublicKey : public virtual EC_PublicKey
 /**
 * This class represents ECDH Private Keys.
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) ECDH_PrivateKey final : public ECDH_PublicKey,
                                   public EC_PrivateKey,
                                   public PK_Key_Agreement_Key
@@ -108,6 +112,8 @@ class BOTAN_PUBLIC_API(2,0) ECDH_PrivateKey final : public ECDH_PublicKey,
                                  std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ecdsa/ecdsa.h b/src/lib/pubkey/ecdsa/ecdsa.h
index c4b85272d..99a1a4f91 100644
--- a/src/lib/pubkey/ecdsa/ecdsa.h
+++ b/src/lib/pubkey/ecdsa/ecdsa.h
@@ -88,6 +88,10 @@ class BOTAN_PUBLIC_API(2,0) ECDSA_PublicKey : public virtual EC_PublicKey
 /**
 * This class represents ECDSA Private Keys
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) ECDSA_PrivateKey final : public ECDSA_PublicKey,
                                    public EC_PrivateKey
    {
@@ -123,6 +127,8 @@ class BOTAN_PUBLIC_API(2,0) ECDSA_PrivateKey final : public ECDSA_PublicKey,
                              std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ecgdsa/ecgdsa.h b/src/lib/pubkey/ecgdsa/ecgdsa.h
index f054b6d91..f670c6674 100644
--- a/src/lib/pubkey/ecgdsa/ecgdsa.h
+++ b/src/lib/pubkey/ecgdsa/ecgdsa.h
@@ -67,6 +67,10 @@ class BOTAN_PUBLIC_API(2,0) ECGDSA_PublicKey : public virtual EC_PublicKey
 /**
 * This class represents ECGDSA private keys.
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) ECGDSA_PrivateKey final : public ECGDSA_PublicKey,
                                     public EC_PrivateKey
    {
@@ -102,6 +106,8 @@ class BOTAN_PUBLIC_API(2,0) ECGDSA_PrivateKey final : public ECGDSA_PublicKey,
                              std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ecies/ecies.cpp b/src/lib/pubkey/ecies/ecies.cpp
index 64f89432e..2b94ab371 100644
--- a/src/lib/pubkey/ecies/ecies.cpp
+++ b/src/lib/pubkey/ecies/ecies.cpp
@@ -19,6 +19,10 @@ namespace {
 /**
 * Private key type for ECIES_ECDH_KA_Operation
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class ECIES_PrivateKey final : public EC_PrivateKey, public PK_Key_Agreement_Key
    {
    public:
@@ -59,6 +63,8 @@ class ECIES_PrivateKey final : public EC_PrivateKey, public PK_Key_Agreement_Key
       ECDH_PrivateKey m_key;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 /**
 * Implements ECDH key agreement without using the cofactor mode
 */
diff --git a/src/lib/pubkey/eckcdsa/eckcdsa.h b/src/lib/pubkey/eckcdsa/eckcdsa.h
index e896eaf54..4b2be867a 100644
--- a/src/lib/pubkey/eckcdsa/eckcdsa.h
+++ b/src/lib/pubkey/eckcdsa/eckcdsa.h
@@ -66,6 +66,10 @@ class BOTAN_PUBLIC_API(2,0) ECKCDSA_PublicKey : public virtual EC_PublicKey
 /**
 * This class represents ECKCDSA private keys.
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) ECKCDSA_PrivateKey final : public ECKCDSA_PublicKey,
                                     public EC_PrivateKey
    {
@@ -101,6 +105,8 @@ class BOTAN_PUBLIC_API(2,0) ECKCDSA_PrivateKey final : public ECKCDSA_PublicKey,
                              std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/ed25519/ed25519.h b/src/lib/pubkey/ed25519/ed25519.h
index 206cb87ff..b02dd4206 100644
--- a/src/lib/pubkey/ed25519/ed25519.h
+++ b/src/lib/pubkey/ed25519/ed25519.h
@@ -63,6 +63,9 @@ class BOTAN_PUBLIC_API(2,2) Ed25519_PublicKey : public virtual Public_Key
       std::vector<uint8_t> m_public;
    };
 
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,2) Ed25519_PrivateKey final : public Ed25519_PublicKey,
                                      public virtual Private_Key
    {
@@ -107,6 +110,8 @@ class BOTAN_PUBLIC_API(2,2) Ed25519_PrivateKey final : public Ed25519_PublicKey,
       secure_vector<uint8_t> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 void ed25519_gen_keypair(uint8_t pk[32], uint8_t sk[64], const uint8_t seed[32]);
 
 void ed25519_sign(uint8_t sig[64],
diff --git a/src/lib/pubkey/elgamal/elgamal.h b/src/lib/pubkey/elgamal/elgamal.h
index f638f9ecc..66815e01e 100644
--- a/src/lib/pubkey/elgamal/elgamal.h
+++ b/src/lib/pubkey/elgamal/elgamal.h
@@ -75,6 +75,10 @@ class BOTAN_PUBLIC_API(2,0) ElGamal_PublicKey : public virtual Public_Key
 /**
 * ElGamal Private Key
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) ElGamal_PrivateKey final :
    public ElGamal_PublicKey,
    public virtual Private_Key
@@ -122,6 +126,8 @@ class BOTAN_PUBLIC_API(2,0) ElGamal_PrivateKey final :
       std::shared_ptr<const DL_PrivateKey> m_private_key;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/gost_3410/gost_3410.h b/src/lib/pubkey/gost_3410/gost_3410.h
index a4c109f96..99b2dc071 100644
--- a/src/lib/pubkey/gost_3410/gost_3410.h
+++ b/src/lib/pubkey/gost_3410/gost_3410.h
@@ -75,6 +75,10 @@ class BOTAN_PUBLIC_API(2,0) GOST_3410_PublicKey : public virtual EC_PublicKey
 /**
 * GOST-34.10 Private Key
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) GOST_3410_PrivateKey final :
    public GOST_3410_PublicKey, public EC_PrivateKey
    {
@@ -109,6 +113,8 @@ class BOTAN_PUBLIC_API(2,0) GOST_3410_PrivateKey final :
                              std::string_view provider) const override;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/kyber/kyber_common/kyber.h b/src/lib/pubkey/kyber/kyber_common/kyber.h
index da13d625d..da6d12ecc 100644
--- a/src/lib/pubkey/kyber/kyber_common/kyber.h
+++ b/src/lib/pubkey/kyber/kyber_common/kyber.h
@@ -115,6 +115,9 @@ class BOTAN_PUBLIC_API(3, 0) Kyber_PublicKey : public virtual Public_Key
       std::shared_ptr<Kyber_PublicKeyInternal> m_public;
    };
 
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(3, 0) Kyber_PrivateKey final : public virtual Kyber_PublicKey, public virtual Private_Key
    {
    public:
@@ -141,6 +144,8 @@ class BOTAN_PUBLIC_API(3, 0) Kyber_PrivateKey final : public virtual Kyber_Publi
       std::shared_ptr<Kyber_PrivateKeyInternal> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 } // namespace Botan
 
 #endif
diff --git a/src/lib/pubkey/mce/mceliece.h b/src/lib/pubkey/mce/mceliece.h
index 9c530a15d..0fc6f6e1c 100644
--- a/src/lib/pubkey/mce/mceliece.h
+++ b/src/lib/pubkey/mce/mceliece.h
@@ -73,6 +73,9 @@ class BOTAN_PUBLIC_API(2,0) McEliece_PublicKey : public virtual Public_Key
       size_t m_code_length;
    };
 
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) McEliece_PrivateKey final : public virtual McEliece_PublicKey,
                                       public virtual Private_Key
    {
@@ -141,6 +144,8 @@ class BOTAN_PUBLIC_API(2,0) McEliece_PrivateKey final : public virtual McEliece_
       size_t m_dimension;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 /**
 * Estimate work factor for McEliece
 * @return estimated security level for these key parameters
diff --git a/src/lib/pubkey/rsa/rsa.h b/src/lib/pubkey/rsa/rsa.h
index f8e175ff9..aa5f30a7f 100644
--- a/src/lib/pubkey/rsa/rsa.h
+++ b/src/lib/pubkey/rsa/rsa.h
@@ -96,6 +96,10 @@ class BOTAN_PUBLIC_API(2,0) RSA_PublicKey : public virtual Public_Key
 /**
 * RSA Private Key
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) RSA_PrivateKey final : public Private_Key, public RSA_PublicKey
    {
    public:
@@ -186,6 +190,8 @@ class BOTAN_PUBLIC_API(2,0) RSA_PrivateKey final : public Private_Key, public RS
       std::shared_ptr<const RSA_Private_Data> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/pubkey/sm2/sm2.h b/src/lib/pubkey/sm2/sm2.h
index 4f7829e7a..1437690d6 100644
--- a/src/lib/pubkey/sm2/sm2.h
+++ b/src/lib/pubkey/sm2/sm2.h
@@ -70,6 +70,10 @@ class BOTAN_PUBLIC_API(2,2) SM2_PublicKey : public virtual EC_PublicKey
 /**
 * This class represents SM2 private keys
 */
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,2) SM2_PrivateKey final :
    public SM2_PublicKey, public EC_PrivateKey
    {
@@ -112,6 +116,8 @@ class BOTAN_PUBLIC_API(2,2) SM2_PrivateKey final :
       BigInt m_da_inv;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 class HashFunction;
 
 std::vector<uint8_t>
diff --git a/src/lib/pubkey/xmss/xmss.h b/src/lib/pubkey/xmss/xmss.h
index b0da60dd6..a24f629a1 100644
--- a/src/lib/pubkey/xmss/xmss.h
+++ b/src/lib/pubkey/xmss/xmss.h
@@ -184,6 +184,10 @@ enum class WOTS_Derivation_Method
  *     Release: May 2018.
  *     https://datatracker.ietf.org/doc/rfc8391/
  **/
+
+BOTAN_DIAGNOSTIC_PUSH
+BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+
 class BOTAN_PUBLIC_API(2,0) XMSS_PrivateKey final : public virtual XMSS_PublicKey,
    public virtual Private_Key
    {
@@ -317,6 +321,8 @@ class BOTAN_PUBLIC_API(2,0) XMSS_PrivateKey final : public virtual XMSS_PublicKe
       std::shared_ptr<XMSS_PrivateKey_Internal> m_private;
    };
 
+BOTAN_DIAGNOSTIC_POP
+
 }
 
 #endif
diff --git a/src/lib/utils/compiler.h b/src/lib/utils/compiler.h
index c9a9b341d..e42b9ca68 100644
--- a/src/lib/utils/compiler.h
+++ b/src/lib/utils/compiler.h
@@ -168,20 +168,24 @@
 #endif
 
 #if defined(BOTAN_BUILD_COMPILER_IS_GCC)
-  #define BOTAN_DIAGNOSTIC_PUSH              _Pragma("GCC diagnostic push")
-  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
-  #define BOTAN_DIAGNOSTIC_POP               _Pragma("GCC diagnostic pop")
+  #define BOTAN_DIAGNOSTIC_PUSH                           _Pragma("GCC diagnostic push")
+  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
+  #define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+  #define BOTAN_DIAGNOSTIC_POP                            _Pragma("GCC diagnostic pop")
 #elif defined(BOTAN_BUILD_COMPILER_IS_CLANG)
-  #define BOTAN_DIAGNOSTIC_PUSH              _Pragma("clang diagnostic push")
-  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
-  #define BOTAN_DIAGNOSTIC_POP               _Pragma("clang diagnostic pop")
+  #define BOTAN_DIAGNOSTIC_PUSH                           _Pragma("clang diagnostic push")
+  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
+  #define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
+  #define BOTAN_DIAGNOSTIC_POP                            _Pragma("clang diagnostic pop")
 #elif defined(BOTAN_BUILD_COMPILER_IS_MSVC)
-  #define BOTAN_DIAGNOSTIC_PUSH              __pragma(warning(push))
-  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED __pragma(warning(disable : 4996))
-  #define BOTAN_DIAGNOSTIC_POP               __pragma(warning(pop))
+  #define BOTAN_DIAGNOSTIC_PUSH                           __pragma(warning(push))
+  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS __pragma(warning(disable : 4996))
+  #define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE __pragma(warning(disable : 4250))
+  #define BOTAN_DIAGNOSTIC_POP                            __pragma(warning(pop))
 #else
   #define BOTAN_DIAGNOSTIC_PUSH
-  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
+  #define BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
+  #define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
   #define BOTAN_DIAGNOSTIC_POP
 #endif
 
diff --git a/src/lib/x509/certstor_system_macos/certstor_macos.cpp b/src/lib/x509/certstor_system_macos/certstor_macos.cpp
index 8c62c45ed..a82479921 100644
--- a/src/lib/x509/certstor_system_macos/certstor_macos.cpp
+++ b/src/lib/x509/certstor_system_macos/certstor_macos.cpp
@@ -267,7 +267,7 @@ class Certificate_Store_MacOS_Impl
          m_keychains(nullptr)
          {
 BOTAN_DIAGNOSTIC_PUSH
-BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
+BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
          // macOS 12.0 deprecates 'Custom keychain management', though the API still works.
          // Ideas for a replacement can be found in the discussion of GH #3122:
          //   https://github.com/randombit/botan/pull/3122


Test patch:
diff --git a/src/tests/test_cryptobox.cpp b/src/tests/test_cryptobox.cpp
index 13c2baac2..b42503b91 100644
--- a/src/tests/test_cryptobox.cpp
+++ b/src/tests/test_cryptobox.cpp
@@ -37,7 +37,7 @@ class Cryptobox_KAT final : public Text_Based_Test
          Fixed_Output_RNG salt_rng(salt);
 
 BOTAN_DIAGNOSTIC_PUSH
-BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED
+BOTAN_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
 
          const std::string ciphertext =
             Botan::CryptoBox::encrypt(input.data(), input.size(), password, salt_rng);