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

MongoDB CXX driver does not compile with standard polyfill.

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.5.0, 3.4.1
    • Affects Version/s: 3.4.0
    • Component/s: Build
    • None
    • Environment:
      Ubuntu 18.04/Arch, GCC 8.2.0

      When trying to build MongoCXX driver with standard polyfill, the build fails.

      Steps to reproduce:

      cd mongo-cxx-driver/build
      cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 ..
      make

      CMake does state that it will be using C++17 std library polyfills:

      -- The CXX compiler identification is GNU 8.2.0
      -- The C compiler identification is GNU 8.2.0
      -- Auto-configuring bsoncxx to use C++17 std library polyfills since C++17 is active and user didn't specify otherwise
      {code]
      
      Running make fails with:
      
      {code:java}
      In file included from /github/mongo-cxx-driver/src/mongocxx/private/client_session.hh:24,
                       from /github/mongo-cxx-driver/src/mongocxx/bulk_write.cpp:25:
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh: In member function 'std::optional<mongocxx::v_noabi::read_concern> mongocxx::v_noabi::options::transaction::impl::read_concern() const':
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh:64:88: error: could not convert '{std::make_unique(_Args&& ...) [with _Tp = mongocxx::v_noabi::read_concern::impl; _Args = {_mongoc_read_concern_t*}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<mongocxx::v_noabi::read_concern::impl>]()}' from '<brace-enclosed initializer list>' to 'std::optional<mongocxx::v_noabi::read_concern>'
               return {stdx::make_unique<read_concern::impl>(libmongoc::read_concern_copy(rc))};
                                                                                              ^
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh: In member function 'std::optional<mongocxx::v_noabi::write_concern> mongocxx::v_noabi::options::transaction::impl::write_concern() const':
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh:77:90: error: could not convert '{std::make_unique(_Args&& ...) [with _Tp = mongocxx::v_noabi::write_concern::impl; _Args = {_mongoc_write_concern_t*}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<mongocxx::v_noabi::write_concern::impl>]()}' from '<brace-enclosed initializer list>' to 'std::optional<mongocxx::v_noabi::write_concern>'
               return {stdx::make_unique<write_concern::impl>(libmongoc::write_concern_copy(wc))};
                                                                                                ^
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh: In member function 'std::optional<mongocxx::v_noabi::read_preference> mongocxx::v_noabi::options::transaction::impl::read_preference() const':
      /github/mongo-cxx-driver/src/mongocxx/options/private/transaction.hh:90:89: error: could not convert '{std::make_unique(_Args&& ...) [with _Tp = mongocxx::v_noabi::read_preference::impl; _Args = {_mongoc_read_prefs_t*}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptr<mongocxx::v_noabi::read_preference::impl>]()}' from '<brace-enclosed initializer list>' to 'std::optional<mongocxx::v_noabi::read_preference>'
               return {stdx::make_unique<read_preference::impl>(libmongoc::read_prefs_copy(rp))};
      

      When using MNMLSTC, everything is working fine.

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            typic4l Piotr Szczepanski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: