From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10281 invoked by alias); 28 Feb 2002 17:56:02 -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 10207 invoked by uid 71); 28 Feb 2002 17:56:01 -0000 Resent-Date: 28 Feb 2002 17:56:01 -0000 Resent-Message-ID: <20020228175601.10206.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, cagdasozgenc@hotmail.com Received:(qmail 7880 invoked by uid 61); 28 Feb 2002 17:52:46 -0000 Message-Id:<20020228175246.7877.qmail@sources.redhat.com> Date: Thu, 28 Feb 2002 10:46:00 -0000 From: cagdasozgenc@hotmail.com Reply-To: cagdasozgenc@hotmail.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5792: g++ fails with functions as arguments X-SW-Source: 2002-02/txt/msg00762.txt.bz2 List-Id: >Number: 5792 >Category: c++ >Synopsis: g++ fails with functions as arguments >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: rejects-legal >Submitter-Id: net >Arrival-Date: Thu Feb 28 09:56:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: cagdasozgenc@hotmail.com >Release: 3.0.4 >Organization: >Environment: redhat linux 7.2 dual pentium 800Mhz >Description: #include #include #include #include #include #include using namespace std; typedef map Index; int main(int argc, char* argv[]) { Index index; ifstream ifs(argv[1]); string word; while(ifs >> word) { transform(word.begin(),word.end(),word.begin(),tolower); index[word]++; } cout.setf(ios::left); for(Index::const_iterator i = index.begin(); i != index.end(); ++i) { cout << setw(20) << i->first << " : " << i -> second << endl; } return 0; } transform function won't accept to lower without a typecast. for_each function will not work either for the same reason. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: