From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,692918d8dd109f14,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1994-08-16 10:06:09 PST Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!zip.eecs.umich.edu!umn.edu!newsdist.tc.umn.edu!mayonews.mayo.edu!chirpa!stan From: stan@chirpa.mayo.edu (Andrew Staniszewski) Newsgroups: comp.unix.osf.osf1 Subject: DEC C++, request for improvement ... Date: 16 Aug 1994 16:26:13 GMT Organization: Mayo Foundataion Sender: stan@chirpa (Andrew Staniszewski) Distribution: world Message-ID: <32qpb5$q3f@fermat.mayo.edu> Reply-To: staniszewski@mayo.edu NNTP-Posting-Host: chirpa.mayo.edu X-Newsreader: mxrn 6.18-9 Hi, I ran accross a name space problem, and found differnt responses from differnt C++ compilers. if an enumeration is declared in the base class scope, and the name of a derived classes matches one of the enumerated values, the compiler reports a syntax error when the derived class has its own type as a parameter passed into one of its members. It would be nice if the compiler at least warned about the name space collision, and if it gave a more intellegint message than syntax error: sample code: ----------------------------------------------------------------------- class dada { public: enum blah {ahh,daaa}; }; // // this is a terible thing to do, the class will have a name matching // an enumeration within its own scope, this needs at least a warning. class daaa : private dada { blah a; public: daaa() {a=daaa;} }; // this has the same problem as the example above, but we get a syntax // error because of the name confusion. The compiler should say more than // syntax error. class ahh : private dada { public: ahh(const ahh &da); }; -- ------------------------------------------------------------------------------ Andrew Staniszewski staniszewski@mayo.edu " ... is everybody else going forwards, or are we just going backwards ??" MDE ------------------------------------------------------------------------------