Remove use of MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Service Arch 2023-04-03
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE macro is not defined in our codebase. Unfortunately, we still reference it, and safety checks will change their behavior based on it.

      In particular DataRange-like types use a data serializer/deserializer template called DataType::Handler, whose default implementation guards a safety check behind MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE. This guard prevents the safety check from being evaluated. As a result, code like

        uassertStatusOK(bodyBuilder.writeAndAdvance<std::string>(reply.body));
      

      Will incorrectly compile and run, and will not load reply.body's text into the builder.

            Assignee:
            Billy Donahue
            Reporter:
            Spencer Jackson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: