-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Description
After the MSYS update, I cannot compile the Poco file because the latest version of GCC has the std::format function, and due to ADL, it is searching for the format function in the std namespace. This is causing an error
You gotta change format->Poco::format in your headers like that:
template <
typename T,
typename... Args>
void format(std::string& result, const std::string& fmt, T arg1, Args... args)
/// Appends the formatted string to result.
{
std::vector values;
values.reserve(sizeof...(Args) + 1);
values.emplace_back(arg1);
values.insert(values.end(), { args... });
Poco::format(result, fmt, values);
}
The error is below:
C:/msys64/mingw64/include/Poco/Format.h:112:21: note: candidate function
void Foundation_API format(std::string& result, const std::string& fmt, const std::vector& values);
^
C:/msys64/mingw64/include/Poco/Format.h:120:6: note: candidate function [with T = std::vectorPoco::Any, Args = <>]
void format(std::string& result, const std::string& fmt, T arg1, Args... args)
^
C:/msys64/mingw64/include/Poco/Format.h:156:2: error: call to 'format' is ambiguous
format(result, fmt, values);
^~~~~~
C:/msys64/mingw64/include/Poco/Format.h:120:6: note: candidate function [with T = std::vectorPoco::Any, Args = <>]
void format(std::string& result, const std::string& fmt, T arg1, Args... args)
^
C:/msys64/mingw64/include/Poco/Format.h:148:13: note: candidate function [with T = std::basic_string, Args = <std::vectorPoco::Any>]
std::string format(const std::string& fmt, T arg1, Args... args)
^
C:/msys64/mingw64/include/c++/13.1.0/format:3713:5: note: candidate function [with _Args = <const std::basic_string &, std::vectorPoco::Any &>]
format(format_string<_Args...> __fmt, _Args&&... __args)
^
C:/msys64/mingw64/include/Poco/Format.h:112:21: note: candidate function
void Foundation_API format(std::string& result, const std::string& fmt, const std::vector& values);
^
C:/msys64/mingw64/include/Poco/Format.h:172:2: error: call to 'format' is ambiguous
format(result, fmt, values);
^~~~~~
C:/msys64/mingw64/include/Poco/Format.h:134:6: note: candidate function [with T = std::vectorPoco::Any, Args = <>]
void format(std::string& result, const char* fmt, T arg1, Args... args)
^
C:/msys64/mingw64/include/c++/13.1.0/format:3713:5: note: candidate function [with _Args = <const char *&, std::vectorPoco::Any &>]
format(format_string<_Args...> __fmt, _Args&&... __args)
^