This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]