[Bug c++/81992] C++ toupper symbol clash?

jg at jguk dot org gcc-bugzilla@gcc.gnu.org
Tue Aug 29 13:25:00 GMT 2017


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.


More information about the Gcc-bugs mailing list