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: "jg at jguk dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 Aug 2017 12:09:49 +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
--- Comment #4 from Jonny Grant <jg at jguk dot org> ---
Hello Jonathan and Daniel
Thank you for your replies.
The stackoverlflow article suggests using <locale> which provides a
std::toupper().
I did change to that, but it still had same issue:
A)
std::transform(str.begin(), str.end(), str.begin(), std::tolower);
B)
I changed again, to cast to function pointer, and that did compile:
std::transform(str.begin(), str.end(), str.begin(), (int
(*)(int))std::tolower);
Unsure why it didn't find std::tolower directly as per (A) above.
It would have been simpler if C++ never re-used any symbol names that were also
present in C.