'str::<std::string>compare' doesn't look like valid C++ syntax. It could be 'str::compare<std::string>' however.
------------------ Best regards, lh_mouse 2016-06-15 ------------------------------------------------------------- 发件人:Jim Michaels <[email protected]> 发送日期:2016-06-15 11:18 收件人:Mingw-w64-public 抄送: 主题:[Mingw-w64-public] problem with templated functions, namespaced find() and compare(), and std:: I have my own compare and find functions I use in a strings library. though they are in their own namespace, they conflict with the ones in <string>. this is 4 screens long. Tue 06/14/2016 20:05:25.24|C:\Users\Kristina\Desktop\prj\egrepsed\egrepsed-1.0\win|+>gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=c:/gcc-7-win32/bin/../libexec/gcc/i686-w64-mingw32/7.0.0/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: /home/cauchy/vcs/svn/gcc/trunk/configure --prefix=/home/cauchy/native/gcc-7-win32 --with-sysroot=/home/cauchy/native/gcc-7-win32 --build=x 86_64-unknown-linux-gnu --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-multilib --disable-nls --disable-win32-registry --disable-gcov-tool --e nable-checking=release --enable-languages=c,c++,fortran --enable-fully-dynamic-string --with-arch=core2 --with-tune=generic Thread model: win32 gcc version 7.0.0 20160609 (experimental) (GCC) Tue 06/14/2016 20:15:36.84|C:\Users\Kristina\Desktop\prj\egrepsed\egrepsed-1.0\win|+> if you want to know, my prompt is an environment variable: Tue 06/14/2016 20:16:46.74|C:\Users\Kristina\Desktop\prj\egrepsed\egrepsed-1.0\win|+>echo %PROMPT% $d$s$t$b$p$b$m$+$g if you prefer $ instead of > use $$ problem with gcc and c++ ENBF?: there are about 4000 lines worth of errors like this and others. do you need a log file? the functions are templated. do you have an idea how long before the EBNF for C++ gets fixed? egrepsed.cpp:2208:33: error: expected primary-expression before '>' token 0==str::<std::string>compare(argv[0],"/sri",true,0)|| ^ In file included from egrepsed.cpp:58:0: ../../../lib/strfuncs/strfuncs.h:253:30: error: explicit qualification in declaration of 'S str::localestringlower(S&)' S str::localestringlower(S& s); ^ In file included from c:\gcc-7-win32\include\c++\7.0.0\bits\locale_facets.h:48:0, from c:\gcc-7-win32\include\c++\7.0.0\bits\basic_ios.h:37, from c:\gcc-7-win32\include\c++\7.0.0\ios:44, from c:\gcc-7-win32\include\c++\7.0.0\ostream:38, from c:\gcc-7-win32\include\c++\7.0.0\iterator:64, from egrepsed.cpp:38: c:\gcc-7-win32\include\c++\7.0.0\bits\streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_ CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&) find(istreambuf_iterator<_CharT> __first, ^~~~ egrepsed.cpp: In function 'bool OSCompareString(std::__cxx11::string, std::__cxx11::string)' egrepsed.cpp:1425:17: error: expected unqualified-id before '<' token return str::<std::string>compare(a,b,caseInsensitiveOS,0) < 0; ^ egrepsed.cpp:1425:29: error: expected primary-expression before '>' token return str::<std::string>compare(a,b,caseInsensitiveOS,0) < 0; ^ egrepsed.cpp:1425:30: error: 'compare' was not declared in this scope return str::<std::string>compare(a,b,caseInsensitiveOS,0) < 0; ^~~~~~~ egrepsed.cpp:1425:30: note: suggested alternative: In file included from egrepsed.cpp:58:0: ../../../lib/strfuncs/strfuncs.h:261:5: note: 'str::compare' int str::compare(S& first, S& second, bool iCase=false, size_t firstPos=0); ^~~ egrepsed.cpp: In function 'int main(int, char**)': egrepsed.cpp:2079:21: error: expected unqualified-id before '<' token 0==str::<std::string>compare(argv[0], "--?",true,0)|| ^ egrepsed.cpp:2079:33: error: expected primary-expression before '>' token 0==str::<std::string>compare(argv[0], "--?",true,0)|| ^ egrepsed.cpp:2079:34: error: 'compare' was not declared in this scope 0==str::<std::string>compare(argv[0], "--?",true,0)|| ^~~~~~~ egrepsed.cpp:2079:34: note: suggested alternative: In file included from egrepsed.cpp:58:0: ../../../lib/strfuncs/strfuncs.h:261:5: note: 'str::compare' int str::compare(S& first, S& second, bool iCase=false, size_t firstPos=0); ^~~ egrepsed.cpp:2080:21: error: expected unqualified-id before '<' token 0==str::<std::string>compare(argv[0], "-?",true,0)|| ^ egrepsed.cpp:2080:33: error: expected primary-expression before '>' token 0==str::<std::string>compare(argv[0], "-?",true,0)|| ^ c:\gcc-5-win32\include\c++\5.3.1\bits\predefined_ops.h: In instantiation of 'bool __gnu_cxx::__ops::_Iter_comp_val<_Compare>::operator()(_Iterator, _Value& ) [with _Iterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Value = SDF; _Compare = bool (*)(SDF&, SDF&, bool)]': c:\gcc-5-win32\include\c++\5.3.1\bits\stl_heap.h:129:48: required from 'void std::__push_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Distance = int; _Tp = SDF; _Compare = __gnu_cxx::__ops::_Iter_comp_v al<bool (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_heap.h:228:23: required from 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compar e) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Distance = int; _Tp = SDF; _Compare = __gnu_cxx::__ops::_Iter_comp _iter<bool (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_heap.h:333:22: required from 'void std::__make_heap(_RandomAccessIterator, _RandomAccessIterator, _Compare) [wi th _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(SDF&, SDF&, bool)>] ' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_algo.h:1669:23: required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAcc essIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bo ol (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_algo.h:1928:25: required from 'void std::__partial_sort(_RandomAccessIterator, _RandomAccessIterator, _RandomAc cessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<b ool (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_algo.h:1943:27: required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Size = int; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bo ol (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_algo.h:1963:25: required from 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _ RandomAccessIterator = __gnu_cxx::__normal_iterator<SDF*, std::vector<SDF> >; _Compare = __gnu_cxx::__ops::_Iter_comp_iter<bool (*)(SDF&, SDF&, bool)>]' c:\gcc-5-win32\include\c++\5.3.1\bits\stl_algo.h:4729:18: required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_i terator<SDF*, std::vector<SDF> >; _Compare = bool (*)(SDF&, SDF&, bool)]' ..\..\..\lib\strfuncs\strfuncs.cpp:1602:82: required from here c:\gcc-5-win32\include\c++\5.3.1\bits\predefined_ops.h:144:37: error: too few arguments to function { return bool(_M_comp(*__it, __val)); } ^ ------------- Jim Michaels<[email protected]> http://www.JesusnJim.com (computer repair info, programming) ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381 _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
