home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16733 < prev    next >
Encoding:
Text File  |  1992-11-22  |  1.1 KB  |  41 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!brunix!cs.brown.edu!pcm
  3. From: pcm@cs.brown.edu (Peter C. McCluskey)
  4. Subject: cfront bug with 2 nested classes
  5. Message-ID: <1992Nov22.210502.2871@cs.brown.edu>
  6. Sender: news@cs.brown.edu
  7. Organization: Brown Computer Science Dept.
  8. Date: Sun, 22 Nov 1992 21:05:02 GMT
  9. Lines: 30
  10.  
  11. CC 3.0.1 (on a Sparc 1) thinks that A::C and A::D are the
  12. same type. It ignores the type error on line 12 but falsely
  13. complains that the operators on lines 16 & 17 are the same.
  14.  
  15. class A
  16. {
  17.  public:
  18.   class C  {   public:    C(short,short){}  };
  19.   class D  {   public:    D(float){}  };
  20.   A(const C&){}
  21. };
  22.  
  23. main()
  24. {
  25.    A g(A::D(1.0));             // line 12 - argument of wrong type
  26. }
  27.  
  28. class ostream;
  29. ostream& operator<<(ostream& o,const A::C&){ return o; }
  30. ostream& operator<<(ostream& o,const A::D&){ return o; }  // line 17
  31.  
  32.  
  33. /cs/bin/CC3.0.1/CC t.C
  34. CC  t.C:
  35. "t.C", line 17: error: two definitions of operator <<()
  36. 1 error
  37.  
  38. ----------------------------------------------------------------------
  39.   >> Peter McCluskey >> pcm@cs.brown.edu >>   Reunite Gondwanaland!
  40. ----------------------------------------------------------------------
  41.