This is the mail archive of the gcc-bugs@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]

Bugreport


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
};

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