This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
a problem about gcc-3.2?
- From: zsf00 at mails dot tsinghua dot edu dot cn
- To: gcc at gcc dot gnu dot org
- Date: Tue, 10 Sep 2002 15:59:28 +0800
- Subject: 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