[CXX-838] Does not compile on apple-clang-7 Created: 03/Feb/16  Updated: 18/Feb/16  Resolved: 18/Feb/16

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: S Roychowdhury Assignee: Andrew Morrow (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CXX-836 Missing #include <string> in mongo-cx... Closed

 Description   

I am using
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.3.0
Thread model: posix

The compilation fails with

[ 3%] Built target EP_mnmlstc_core
[ 4%] Building CXX object src/bsoncxx/CMakeFiles/bsoncxx.dir/exception/error_code.cpp.o
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:30:17: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
std::string message(int condition) const noexcept override {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:33:24: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
return "tried to append new key while in subarray";
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:35:24: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
return "tried to close array while in subdocument";
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:37:24: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
return "tried to close document while in a subarray";
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:39:24: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
return "tried to operate on document, but this is an array";
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:41:24: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
return "tried to operate on array, but this is a document";
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:19:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(double, 0x01)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:20:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(utf8, 0x02)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:21:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(document, 0x03)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:22:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(array, 0x04)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:23:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(binary, 0x05)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:24:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(undefined, 0x06)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:25:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(oid, 0x07)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:26:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(bool, 0x08)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:27:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(date, 0x09)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:28:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(null, 0x0A)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:29:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(regex, 0x0B)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name};
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:30:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(dbpointer, 0x0C)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return {"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
In file included from /Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:45:
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/enums/type.hpp:31:1: error: implicit instantiation of undefined template 'std::_1::basic_string<char, std::1::char_traits<char>, std::_1::allocator<char> >'
BSONCXX_ENUM(code, 0x0D)
^
/Path/to/mongo-cxx-driver-r3.0.0/src/bsoncxx/exception/error_code.cpp:44:16: note: expanded from macro 'BSONCXX_ENUM'
return

{"expected element type k_" #name}

;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note: template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/bsoncxx/CMakeFiles/bsoncxx.dir/exception/error_code.cpp.o] Error 1
make[1]: *** [src/bsoncxx/CMakeFiles/bsoncxx.dir/all] Error 2
make: *** [all] Error 2



 Comments   
Comment by Andrew Morrow (Inactive) [ 18/Feb/16 ]

Community pull request: https://github.com/mongodb/mongo-cxx-driver/pull/458

Generated at Wed Feb 07 22:00:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.