home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!brunix!cs.brown.edu!pcm
- From: pcm@cs.brown.edu (Peter C. McCluskey)
- Subject: cfront bug with 2 nested classes
- Message-ID: <1992Nov22.210502.2871@cs.brown.edu>
- Sender: news@cs.brown.edu
- Organization: Brown Computer Science Dept.
- Date: Sun, 22 Nov 1992 21:05:02 GMT
- Lines: 30
-
- CC 3.0.1 (on a Sparc 1) thinks that A::C and A::D are the
- same type. It ignores the type error on line 12 but falsely
- complains that the operators on lines 16 & 17 are the same.
-
- class A
- {
- public:
- class C { public: C(short,short){} };
- class D { public: D(float){} };
- A(const C&){}
- };
-
- main()
- {
- A g(A::D(1.0)); // line 12 - argument of wrong type
- }
-
- class ostream;
- ostream& operator<<(ostream& o,const A::C&){ return o; }
- ostream& operator<<(ostream& o,const A::D&){ return o; } // line 17
-
-
- /cs/bin/CC3.0.1/CC t.C
- CC t.C:
- "t.C", line 17: error: two definitions of operator <<()
- 1 error
-
- ----------------------------------------------------------------------
- >> Peter McCluskey >> pcm@cs.brown.edu >> Reunite Gondwanaland!
- ----------------------------------------------------------------------
-