This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81992] C++ toupper symbol clash?
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 27 Aug 2017 14:59:14 +0000
- Subject: [Bug c++/81992] C++ toupper symbol clash?
- Auto-submitted: auto-generated
- References: <bug-81992-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81992
Daniel Krügler <daniel.kruegler at googlemail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |daniel.kruegler@googlemail.
| |com
--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This is a programming error on your side: The compiler sees two functions
tolower in the global namespace and both could be used equally good for
deduction purposes in the call:
std::transform(str.begin(), str.end(), str.begin(), ::tolower);
Since both could be used to deduce the template parameter UnaryOperation, this
deduction fails and the std::transform template with four function parameters
is excluded from overload resolution. The remaining one has five parameters and
fails as well. You can help the compiler by introducing a lambda expression:
std::transform(str.begin(), str.end(), str.begin(), [](auto c){ return
::tolower(c); });
Now the compiler can perform overload resolution on the call expression
::tolower(c) and can determine a single best candidate.