home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2116 < prev    next >
Encoding:
Text File  |  1993-01-03  |  1.2 KB  |  50 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!spool.mu.edu!uwm.edu!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!regent.e-technik.tu-muenchen.dbp.DE!Peter.Schauer
  3. From: Peter.Schauer@regent.e-technik.tu-muenchen.dbp.DE (Peter Schauer)
  4. Subject: Severe problem with gcc-2.3.[23], conversions and assignment operators
  5. Message-ID: <93Jan3.232955met.20493@rebus.regent.e-technik.tu-muenchen.de>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 4 Jan 1993 00:29:48 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 37
  12.  
  13. The following program causes gcc-2.3.[23] to go into an infinite loop
  14. on all platforms till virtual memory is exhausted.
  15. If the assignment operator function is removed, it compiles ok.
  16. If the copy constructor is removed and the assignment operator is kept,
  17. the following warning is issued:
  18. crashme.C: In function `void  crashme ()':
  19. crashme.C: too many arguments for constructor `V'
  20.  
  21. gcc-2.3.1 and earlier compiles ok in all cases.
  22.  
  23. class M;
  24. class V
  25. {
  26. public:
  27.     V ();
  28.     V (const V&);
  29.     V& operator = (const V&);
  30. };
  31. class M
  32. {
  33. public:
  34.     M ();
  35.     operator V ();
  36.     M some_func (void);
  37. };
  38. void
  39. crashme (void)
  40. {
  41.     V v;
  42.     M m;
  43.  
  44.     v = m.some_func();
  45. }
  46.  
  47. -- 
  48. Peter Schauer            pes@regent.e-technik.tu-muenchen.de
  49.  
  50.