Fix tests build failure on clang and gcc-12 Both gcc-12 and clang can't find ostream<<(..., std::pair<...>) overload when compile lib/tests/test_wordtokenizer_main.cpp and fail as:
./../srchilite/tostringcollection.h:103:9: error no match for «operator<<» (operand types are «std::ostringstream» {aka «std::__cxx11::basic_ostringstream<char>»} and «const std::pair<std::__cxx11::basic_string<char>, std::__cxx11::basic_string<char> >») 103 | buf << (*it); | ~~~~^~~~~~~~
We fix it by placing overload to std namespace where std::pair<...> is defined to make ADL work predictably.
clang also has a trouble compiling lib/tests/stdboosterror.h as:
./stdboosterror.h:7:72: error: parameter declarator cannot be qualified std_boost_exception(boost::regex_error(boost::regex_constants::error_bad_pattern)); ~~~~~~~~~~~~~~~~~~~~~~~~^
gcc compiles it by accident: https://gcc.gnu.org/PR86564
Let's disambiguate syntax by making it an explicit constructor call.
Sergei Trofimovich <slyich@gmail.com>
no
2021-11-08
Showing 1 to 3 of 3 entries
All known versions for source package 'source-highlight'