It would be nice to be able to test deprecated driver functionality without generating deprecation warnings in the test compile output.
In clang, deprecation warnings can be disabled for a section of code as follows:
#pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" ... #pragma clang diagnostic pop
We should hide such compiler-specific functionality behind a header or macro, and have test code use this mechanism to disable deprecation warnings for the tests of deprecated functionality.
As part of the work for this ticket, all existing deprecated API methods should have the BSONCXX_DEPRECATED or MONGOCXX_DEPRECATED specifier added to the method declaration. No deprecation specifiers will be added to public types.
In addition, as part of the work for this ticket, we should remove "-Wno-error=deprecated-declarations" from our Evergreen compiler flags, which was temporarily added to work around CXX-1226.
- causes
-
CXX-1447 Reduce use of deprecated methods in test files
- Closed
- is depended on by
-
CXX-1226 Resolve json.cpp compile warnings introduced by deprecation of bson_as_json
- Closed
-
CXX-1232 Backport 'CXX-1226 Resolve json.cpp compile warnings introduced by deprecation of bson_as_json' for 3.1.2
- Closed
-
CXX-979 Add BSONCXX_DEPRECATED to deprecated BSON types
- Closed
- related to
-
CXX-1348 Remove -Werror from CMAKE_CXX_FLAGS around calls to generate_export_header()
- Closed