This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

a problem about gcc-3.2?


hello,

The follow codes compile well with egcs++,g++-2.96 and icc.
But can't compile with g++-3.2
#include <fstream>
#include <iostream>

using namespace std;

class FileStream : public fstream {
    public:
                bool isOpen() const;
};

inline bool FileStream :: isOpen() const    {
            return  fstream::is_open();     //line 78                               
}

int main()
{
    FileStream myFileStream;
    cout << myFileStream.isOpen() << endl;
}

g++-3.2 -o test6 test6.cpp 
test6.cpp: In member function `bool FileStream::isOpen() const':
test6.cpp:12: passing `const std::basic_fstream<char, std::char_traits<char> >' 
   as `this' argument of `bool std::basic_fstream<_CharT, _Traits>::is_open() 
   [with _CharT = char, _Traits = std::char_traits<char>]' discards qualifiers

Is it a bug of gcc-3.2?
Best Regards,

Shaofeng Zhang


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]