Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1056

Add mechanism to disable deprecation warnings for a given section of code

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc0
    • Affects Version/s: None
    • Component/s: Build
    • None

      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.

            Assignee:
            rassi J Rassi
            Reporter:
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: