This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/11108] <iostream> causes transform() to not compile with tolower()
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2003 18:16:00 -0000
- Subject: [Bug libstdc++/11108] <iostream> causes transform() to not compile with tolower()
- References: <20030606070707.11108.davidg@flash.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11108
------- Additional Comments From gdr@integrable-solutions.net 2003-06-06 18:15 -------
Subject: Re: <iostream> causes transform() to not compile with tolower()
"davidg@flash.net" <gcc-bugzilla@gcc.gnu.org> writes:
| At 01:40 PM 6/6/2003 +0000, you wrote:
|
| >| string lcase (const string & s)
| >| {
| >| string result = s;
| >| transform (result.begin(), result.end(), result.begin(), tolower);
| >
| >This is a known issue. See the FAQ and a recent talk of mine and
| >Benjamin's at the recent ACCU conference.
|
| Where might I find this FAQ?
http://linux-rep.fnal.gov/software/gcc/onlinedocs/libstdc++/22_locale/howto.html#7
| I have looked on
| accu.org and accuconference.com to no avail.
A summary of the talk may be found here
http://www.accuconference.co.uk/speakers2003.asp#Gabriel Dos Reis
The set of slides is available at
http://www.cmla.ens-cachan.fr/~dosreis/C++/talks/type-of-toupper.pdf
| Could you please comment more on why this code compiles and executes just
| fine as long as I do NOT include <iostream>.
All I can say is already contained in the FAQ and the set of slides.
| The *inconsistent* handling of
| this code by g++ does seem to be a bug (at least a gnat anyway).
It is not a compiler or library bug. The only bug is in your program.
| Also, this broken code was taken directly from a very well known STL
| book...
Unfortunately, being well known does not imply being correct.
| Should I just chalk this up to a "tightening" of the g++ compiler
| per the evolving C++ standard?
|
| I guess my "work-around" will be to put a wrapper around tolower()? Is
| there any discussion in the standards world about adding template
| compatible tolower/toupper objects? Just curious.
See the FAQ and the set of slides.
-- Gaby