This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11108] New: <iostream> causes transform() to not compile with tolower()
- From: "davidg at flash dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jun 2003 07:07:09 -0000
- Subject: [Bug c++/11108] New: <iostream> causes transform() to not compile with tolower()
- 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
Summary: <iostream> causes transform() to not compile with
tolower()
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: davidg@flash.net
CC: gcc-bugs@gcc.gnu.org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: ../gcc-3.3/configure --enable-languages=c,c++
Thread model: posix
gcc version 3.3
******
The code below causes the following error *only* if <iostream> is included.
I got the same error using g++ v3.2.2
The code compiled fine under an older version of g++ (sorry I don't have the
number)
***
g++ -c -Wall -pipe lcase.cpp -o lcase.o
lcase.cpp: In function `std::string lcase(const std::string&)':
lcase.cpp:16: error: no matching function for call to `transform(
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, <unknown type>)'
// begin lcase.cpp
//
#include <iostream>
#include <algorithm>
#include <string>
#include <cctype>
using namespace std;
//*********************************************************
//*********************************************************
string lcase (const string & s)
{
string result = s;
transform (result.begin(), result.end(), result.begin(), tolower);
return result;
}
//
// end lcase.cpp