From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19328 invoked by alias); 16 Dec 2001 21:53:56 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 19293 invoked by uid 61); 16 Dec 2001 21:53:55 -0000 Date: Sun, 16 Dec 2001 13:53:00 -0000 Message-ID: <20011216215355.19292.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org, schmid@snake.iap.physik.tu-darmstadt.de From: paolo@gcc.gnu.org Reply-To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org, schmid@snake.iap.physik.tu-darmstadt.de, gcc-gnats@gcc.gnu.org X-Mailer: gnatsweb 2.9.3 Subject: Re: libstdc++/5133: Problems with toupper X-SW-Source: 2001-12/txt/msg00920.txt.bz2 List-Id: Synopsis: Problems with toupper Responsible-Changed-From-To: unassigned->paolo Responsible-Changed-By: paolo Responsible-Changed-When: Sun Dec 16 13:53:55 2001 Responsible-Changed-Why: Taking care of this. State-Changed-From-To: open->feedback State-Changed-By: paolo State-Changed-When: Sun Dec 16 13:53:55 2001 State-Changed-Why: Hi Peter, in Josuttis, pp. 499 and 718 I find an explanation of what is happening with your testcase. In a nutshell, tolower and toupper are old C functions (you may use them through cctype) whereas std::toupper(c, loc) (and the corresponding tolower) are global functions of the C++ locales. Therefore, your testcase should be changed to: #include #include #include #include int main() { std::string s("Hallo"); //std::transform (s.begin(), s.end(), s.begin(), std::tolower); //std::transform (s.begin(), s.end(), s.begin(), ::tolower); std::transform (s.begin(), s.end(), s.begin(), tolower); std::cout << "lowered: " << s << std::endl; } which indeed compiles and runs fine. Ok? Cheers, Paolo. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5133