When build the following C++ code:
// test.cpp
#include <map>
#include <string>
#include <iostream>
using namespace std;
int main()
{
map<int, int> m = { {0, 0}, {1, 1} };
cout << "Hello, stdc++17\n";
return 0;
}
1. Build with C++17 and LLVM C++ library, work fine
/root/qnx710/host/linux/x86_64/usr/bin/q++ -Vgcc/8.3.0,gcc_ntox86_64 -Y_cxx -lang-c++ -std=gnu++17 -o test test.cpp
2. Build with C++17 and GNU C++ library: can't work
/root/qnx710/host/linux/x86_64/usr/bin/q++ -Vgcc/8.3.0,gcc_ntox86_64 -Y_gpp -lang-c++ -std=gnu++17 -o test test.cpp
In file included from /root/qnx710/target/qnx7/usr/include/stddef.h:23,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/cxxabi_init_exception.h:38,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/exception_ptr.h:38,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/exception:143,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/new:40,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/ext/new_allocator.h:33,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/x86_64-pc-nto-qnx7.1.0/bits/c++allocator.h:33,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/allocator.h:46,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_tree.h:64,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/map:60,
from test.cpp:1:
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:638:25: error: expected nested-name-specifier before
numeric constant
template<typename _C2>
^~~
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:638:25: error: expected '>' before numeric constant
In file included from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/map:61,
from test.cpp:1:
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:640:34: error: type/value mismatch at argument 3 in
template parameter list for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
merge(map<_Key, _Tp, _C2, _Alloc>& __source)
^
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:640:34: note: expected a type, got '1'
In file included from /root/qnx710/target/qnx7/usr/include/stddef.h:23,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/cxxabi_init_exception.h:38,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/exception_ptr.h:38,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/exception:143,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/new:40,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/ext/new_allocator.h:33,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/x86_64-pc-nto-qnx7.1.0/bits/c++allocator.h:33,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/allocator.h:46,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_tree.h:64,
from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/map:60,
from test.cpp:1:
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:646:25: error: expected nested-name-specifier before numeric constant
template<typename _C2>
^~~
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:646:25: error: expected '>' before numeric constant
In file included from /root/qnx710/target/qnx7/usr/include/c++/8.3.0/map:61,
from test.cpp:1:
/root/qnx710/target/qnx7/usr/include/c++/8.3.0/bits/stl_map.h:648:34: error: type/value mismatch at argument 3 in
template parameter list for 'template<class _Key, class _Tp, class _Compare, class...
View Full Message