Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Message-ID: <009001bea142$412e7630$29acdfd0@InspirePharm.Com> Reply-To: "Suhaib M. Siddiqi" From: "Suhaib M. Siddiqi" To: , References: <199905181520 DOT LAA17067 AT pluto DOT ipass DOT net> Subject: Re: bug in egcs-1.1.2? Date: Tue, 18 May 1999 11:22:34 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id LAA04777 Should these #include #include #include #include #include NOT be #include #include #include #include #include or whatever???? ----- Original Message ----- From: Mike Fabian To: Sent: Tuesday, May 18, 1999 11:20 AM Subject: bug in egcs-1.1.2? > Hello, > > I encountered a problem while using Mumit Khan's egcs-1.1.2 release. > > (~$ g++ --version > egcs-2.91.66 ) > > the following small test program doesn't compile with egcs-1.1.2 > > ---------------------------------------------------------------------- > #include > #include > #include > #include > #include > > class PairsOfStrings : public std::deque > > { > }; > > void main(int argc, char* argv[]) > { > PairsOfStrings d; > std::string s1("field1"),s2("value1"),s3("field2"),s4("value2"); > d.push_back(std::make_pair(s1,s2)); > d.push_back(std::make_pair(s3,s4)); > > std::string str = ""; > for(PairsOfStrings::const_iterator p=d.begin();p!=d.end();p++) { > // the following line doesn't compile with egcs: > str += p->first + p->second; > } > std::cout << str << std::endl; > } > ---------------------------------------------------------------------- > The error message is: > > test.cpp: In function `int main(...)': > test.cpp:21: result of `operator->()' yields non-pointer result > test.cpp:21: result of `operator->()' yields non-pointer result > > When `list' is used instead of `deque', the program compiles fine > and works as expected. > > With Microsoft's VC 5.0 the program compiles without errors > for `deque' as well (and the program runs correctly). > > Is this possibly a bug in egcs?? > > > Mike > > PS: > here is the complete output of the compiler: > ---------------------------------------------------------------------- > cd d:/home/fabian/cpp/ > g++ test.cpp -o test.exe > C:/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/egcs-2.91.66/../../../../../include/g++/stl_deque.h: In method `const struct pair,__default_alloc_template >,basic_string,__default_alloc_template > > & __deque_iterator,__default_alloc_template >,basic_string,__default_alloc_template > >,const pair,__default_alloc_template >,basic_string,__default_alloc_template > > &,const pair,__default_alloc_template >,basic_string,__default_alloc_template > > &,0>::operator ->,__default_alloc_template >,basic_string,__default_alloc_template > >, const pair,__default_alloc_template >,basic_string,__default_alloc_template > > &, const pair,__default_alloc_template >,basic_string,__default_alloc_template > > &, 0>() const': > test.cpp:21: instantiated from here > C:/cygnus/cygwin-b20/H-i586-cygwin32/bin/../lib/gcc-lib/i586-cygwin32/egcs-2.91.66/../../../../../include/g++/stl_deque.h:132: conversion from `const pair,__default_alloc_template >,basic_string,__default_alloc_template > > *' to non-scalar type `pair,__default_alloc_template >,basic_string,__default_alloc_template > >' requested > test.cpp: In function `int main(...)': > test.cpp:21: result of `operator->()' yields non-pointer result > test.cpp:21: result of `operator->()' yields non-pointer result > > Compilation exited abnormally with code 1 at Tue May 18 15:41:19 > ---------------------------------------------------------------------- > > > -- > Want to unsubscribe from this list? > Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com > > -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com