This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bugreport
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: Bugreport
- From: Simon Thum <Simon dot Thum at mni dot fh-giessen dot de>
- Date: Tue, 22 Jun 1999 14:20:33 +0200 (MET DST)
Hi there!
Iīm runnig Intel-Linux and egcs 2.91.66, and had this nasty error.
Members with default args from the class seem to be treated static for
some reason, and I found no explanation in my C++ book.
I have constructed a minimal-case īProgramī to reproduce the bug. I
simply invoked:
g++ egcs-err.cpp
and it stated a static member couldnīt access in-class data.
I ommitted the preprocessing since it should have no meaning.
BTW, on our SUNīs the problem also occurs, with the same egcs.
Good luck
/* A small example to confuse egcs
I looked up Strustrupīs īThe C++ programming languageī, but found nothing
indicating this being a standart violation. In fīs body, however, I can
access i at will. Making aīs default constant does the cut.
My g++ says it is egcs-2.91.66
*/
class X{
private:
int i;
public:
int f(int a=i){return i=a;} //somehow treated as static member
};