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

Call to member function 'append' is ambiguous using libc++

    • Type: Icon: Bug Bug
    • Resolution: Incomplete
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 3.3.0
    • Component/s: Build
    • None
    • Environment:
      Ubuntu Clang-3.8 std=libc++

      I tried to build mongocxx and got some issue related to libc++.

       

      Here the full log:

      root@JackLaptop:/home/lib# rm -R mongo-cxx-driver-r3.3.0/
      root@JackLaptop:/home/lib# tar -xzf r3.3.0.tar.gz
      root@JackLaptop:/home/lib# cd mongo-cxx-driver-r3.3.0/build
      root@JackLaptop:/home/lib/mongo-cxx-driver-r3.3.0/build# cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=OFF -DBSONCXX_POLY_USE_SYSTEM_MNMLSTC=ON -DCMAKE_CXX_FLAGS="-stdlib=libc++" ..
      -- The CXX compiler identification is Clang 3.8.0
      -- Check for working CXX compiler: /usr/bin/clang++-3.8
      -- Check for working CXX compiler: /usr/bin/clang++-3.8 -- works
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- The C compiler identification is Clang 3.8.0
      -- Check for working C compiler: /usr/bin/clang-3.8
      -- Check for working C compiler: /usr/bin/clang-3.8 -- works
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Auto-configuring bsoncxx to use MNMLSTC for polyfills since C++17 is inactive
      -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
      -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
      -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
      -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
      -- Looking for C++ include pthread.h
      -- Looking for C++ include pthread.h - found
      -- Looking for pthread_create
      -- Looking for pthread_create - not found
      -- Check if compiler accepts -pthread
      -- Check if compiler accepts -pthread - yes
      -- Found Threads: TRUE
      -- Configuring done
      -- Generating done
      -- Build files have been written to: /home/lib/mongo-cxx-driver-r3.3.0/build
      root@JackLaptop:/home/lib/mongo-cxx-driver-r3.3.0/build# make && sudo make install
      Scanning dependencies of target bsoncxx_testing
      [  0%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/array/element.cpp.o
      [  1%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/array/value.cpp.o
      [  1%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/array/view.cpp.o
      [  1%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/builder/core.cpp.o
      [  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/decimal128.cpp.o
      [  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/document/element.cpp.o
      [  2%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/document/value.cpp.o
      [  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/document/view.cpp.o
      [  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/exception/error_code.cpp.o
      [  3%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/json.cpp.o
      [  5%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/oid.cpp.o
      [  5%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/private/itoa.cpp.o
      [  5%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/string/view_or_value.cpp.o
      [  6%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/types.cpp.o
      [  6%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/types/value.cpp.o
      [  6%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx_testing.dir/validate.cpp.o
      [  6%] Linking CXX static library libbsoncxx-testing.a
      [  6%] Built target bsoncxx_testing
      Scanning dependencies of target bsoncxx
      [  6%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/array/element.cpp.o
      [  6%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/array/value.cpp.o
      [  7%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/array/view.cpp.o
      [  7%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/builder/core.cpp.o
      [  7%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/decimal128.cpp.o
      [  9%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/document/element.cpp.o
      [  9%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/document/value.cpp.o
      [  9%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/document/view.cpp.o
      [ 10%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/exception/error_code.cpp.o
      [ 10%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/json.cpp.o
      [ 10%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/oid.cpp.o
      [ 11%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/private/itoa.cpp.o
      [ 11%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/string/view_or_value.cpp.o
      [ 11%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/types.cpp.o
      [ 11%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/types/value.cpp.o
      [ 12%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/validate.cpp.o
      [ 12%] Linking CXX static library libbsoncxx-static.a
      [ 12%] Built target bsoncxx
      Scanning dependencies of target test_bson
      [ 12%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/__/__/third_party/catch/main.cpp.o
      [ 12%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_b_date.cpp.o
      [ 14%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_builder.cpp.o
      [ 14%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_get_values.cpp.o
      [ 14%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_types.cpp.o
      [ 15%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_util_itoa.cpp.o
      [ 15%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/bson_validate.cpp.o
      [ 15%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/json.cpp.o
      [ 16%] Building CXX object src/bsoncxx/test/CMakeFiles/test_bson.dir/view_or_value.cpp.o
      [ 16%] Linking CXX executable test_bson
      [ 16%] Built target test_bson
      Scanning dependencies of target mongocxx
      [ 16%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/bulk_write.cpp.o
      [ 16%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/client.cpp.o
      [ 18%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/client_session.cpp.o
      [ 18%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/change_stream.cpp.o
      [ 18%] Building CXX object src/mongocxx/CMakeFiles/mongocxx.dir/collection.cpp.o
      In file included from /home/lib/mongo-cxx-driver-r3.3.0/src/mongocxx/collection.cpp:15:
      In file included from /home/lib/mongo-cxx-driver-r3.3.0/src/mongocxx/collection.hpp:22:
      In file included from /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/basic/array.hpp:19:
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/basic/impl.hpp:55:11: error: call to member function 'append' is
            ambiguous
          core->append(std::forward<T>(t));
          ~~~~~~^~~~~~
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/basic/impl.hpp:60:5: note: in instantiation of function template
            specialization 'bsoncxx::v_noabi::builder::basic::impl::generic_append<long long &>' requested here
          generic_append(core, std::forward<T>(t));
          ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/basic/sub_document.hpp:86:15: note: in instantiation of function
            template specialization 'bsoncxx::v_noabi::builder::basic::impl::value_append<long long &>' requested here
              impl::value_append(_core, std::forward<V>(std::get<1>(t)));
                    ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/basic/sub_document.hpp:47:9: note: in instantiation of function
            template specialization 'bsoncxx::v_noabi::builder::basic::sub_document::append_<15, long long &>' requested here
              append_(std::forward<Arg>(a));
              ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/mongocxx/collection.cpp:233:13: note: in instantiation of function template
            specialization 'bsoncxx::v_noabi::builder::basic::sub_document::append<std::__1::tuple<char const (&)[15], long
            long &>>' requested here
              out.append(bsoncxx::builder::basic::kvp("maxAwaitTimeMS", count));
                  ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:529:11: note: candidate function
          core& append(bool value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:542:11: note: candidate function
          core& append(double value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:555:11: note: candidate function
          core& append(std::int32_t value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:568:11: note: candidate function
          core& append(std::int64_t value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:175:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_double' for 1st argument
          core& append(const types::b_double& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:189:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_utf8' for 1st argument
          core& append(const types::b_utf8& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:203:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_document' for 1st argument
          core& append(const types::b_document& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:217:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_array' for 1st argument
          core& append(const types::b_array& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:231:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_binary' for 1st argument
          core& append(const types::b_binary& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:245:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_undefined' for 1st argument
          core& append(const types::b_undefined& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:259:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_oid' for 1st argument
          core& append(const types::b_oid& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:273:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_bool' for 1st argument
          core& append(const types::b_bool& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:287:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_date' for 1st argument
          core& append(const types::b_date& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:301:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_null' for 1st argument
          core& append(const types::b_null& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:315:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_regex' for 1st argument
          core& append(const types::b_regex& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:329:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_dbpointer' for 1st argument
          core& append(const types::b_dbpointer& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:343:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_code' for 1st argument
          core& append(const types::b_code& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:357:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_symbol' for 1st argument
          core& append(const types::b_symbol& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:371:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_codewscope' for 1st argument
          core& append(const types::b_codewscope& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:385:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_int32' for 1st argument
          core& append(const types::b_int32& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:399:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_timestamp' for 1st argument
          core& append(const types::b_timestamp& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:413:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_int64' for 1st argument
          core& append(const types::b_int64& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:427:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_decimal128' for 1st argument
          core& append(const types::b_decimal128& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:441:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_minkey' for 1st argument
          core& append(const types::b_minkey& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:455:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::b_maxkey' for 1st argument
          core& append(const types::b_maxkey& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:468:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const types::value' for 1st argument
          core& append(const types::value& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:481:11: note: candidate function not viable: no known
            conversion from 'long long' to 'std::string' (aka 'basic_string<char, char_traits<char>, allocator<char> >') for
            1st argument
          core& append(std::string str);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:494:11: note: candidate function not viable: no known
            conversion from 'long long' to 'stdx::string_view' (aka 'basic_string_view<char>') for 1st argument
          core& append(stdx::string_view str);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:581:11: note: candidate function not viable: no known
            conversion from 'long long' to 'const bsoncxx::v_noabi::oid' for 1st argument
          core& append(const oid& value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:594:11: note: candidate function not viable: no known
            conversion from 'long long' to 'bsoncxx::v_noabi::decimal128' for 1st argument
          core& append(decimal128 value);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:607:11: note: candidate function not viable: no known
            conversion from 'long long' to 'document::view' for 1st argument
          core& append(document::view view);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:620:11: note: candidate function not viable: no known
            conversion from 'long long' to 'array::view' for 1st argument
          core& append(array::view view);
                ^
      /home/lib/mongo-cxx-driver-r3.3.0/src/bsoncxx/builder/core.hpp:510:26: note: candidate template ignored: could not match
            'T *' against 'long long'
          BSONCXX_INLINE core& append(T* v) {
                               ^
      1 error generated.
      src/mongocxx/CMakeFiles/mongocxx.dir/build.make:158: recipe for target 'src/mongocxx/CMakeFiles/mongocxx.dir/collection.cpp.o' failed
      make[2]: *** [src/mongocxx/CMakeFiles/mongocxx.dir/collection.cpp.o] Error 1
      CMakeFiles/Makefile2:627: recipe for target 'src/mongocxx/CMakeFiles/mongocxx.dir/all' failed
      make[1]: *** [src/mongocxx/CMakeFiles/mongocxx.dir/all] Error 2
      Makefile:138: recipe for target 'all' failed
      make: *** [all] Error 2
      

       All dependencies are correctly setup since I succeed to build mongocxx with the default std.

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            Jackblue Johnson Jackblue [X]
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: