This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more infromation.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
> Hello, > ################# BEGIN ################################################### > > class Id > { > public: > enum E > { ID }; > }; > > class C > { > public: > C(); > C(Id::E evalue); > }; > > void ActualInstance() > { > C actual(Id::ID); > } > // needed for further demonstration void f(const C&) { } > > void TemporaryInstance() > { > // gcc -v reported: > // Reading specs from /xegcs/lib/gcc-lib/i586-linux-gnu/egcs-2.91.66/specs > // gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release) > > // gcc -c tempobj.cpp reports: > // tempobj.cpp: In function `void TemporaryInstance()': > // tempobj.cpp:33: `class C Id::ID' is not a static member of `class Id' > > C(Id::ID); // it thinks it is the same as C Id::ID //It does not work because it thinks it is a variable declaration of the form type(var), just like int(a); // same as int a; //The following works as expected: f(C(Id::ID)); > > } > > ################# END ################################################### > > ------ > Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ > Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com You say the other compilers work. It is interesting which is right. I do not know. Artiom
begin:vcard n:Alimarine;Artem tel;home:(+31) 40-2440633 tel;work:(+31) 40-2763078 x-mozilla-html:TRUE adr:;;;;;; version:2.1 email;internet:aalimari@best.ms.philips.com fn:Artem Alimarine end:vcard
------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |