Date: Tue, 18 May 1999 11:48:48 -0400 Message-Id: <199905181548.LAA04562@delorie.com> 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 From: Mike Fabian To: cygwin AT sourceware DOT cygnus DOT com Subject: bug in egcs-1.1.2? Reply-to: mike DOT fabian AT it-mannesmann DOT de 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