home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7419 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.3 KB  |  54 lines

  1. Path: cri.ens-lyon.fr!news
  2. From: elesueur@ens-lyon.fr (Emmanuel Lesueur)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: 2 bugs in SAS/C++ 6.56
  5. Date: 16 Apr 1996 10:25:50 GMT
  6. Organization: Ecole Normale Superieure de Lyon, France
  7. Distribution: world
  8. Message-ID: <4kvsje$2b0@cri.ens-lyon.fr>
  9. Reply-To: elesueur@ens-lyon.fr
  10. NNTP-Posting-Host: maxime.ens-lyon.fr
  11.  
  12. Compiling the following code:
  13.  
  14. ----8<----
  15.  
  16. struct V {};
  17. struct A : virtual V {};
  18.  
  19. void foo(A& x, A& y) { x=y; }
  20.  
  21. ----8<----
  22.  
  23. with 'sc resetopts tst.cxx' gives:
  24. "Internal Error: 4546 in /sas/gpp/v652am_cc/cxx/src/type.c."
  25.  
  26. A simple workaround is to define explicitly the assignement 
  27. operator for A (which is a good idea, anyway, since the number
  28. of times the virtual base V is copied by the implicitly defined
  29. assignement operator is unspecified).
  30.  
  31.  
  32. The second bug is a nasty one:
  33.  
  34. ----8<----
  35.  
  36. struct A { A(int&); };
  37.  
  38. void foo(const int& r) { A a(r); }
  39.  
  40. ----8<----
  41.  
  42. Compiling this as above crashes the compiler, with miscellaneous
  43. guru numbers and Enforcer hits (this is the first time I manage to 
  44. crash this compiler).
  45. Of course, the code above is ill-formed (non-const reference
  46. initialized with a const one), but crashing makes it hard to
  47. find the problem.
  48.  
  49. ___________________________________________________
  50.  
  51. Emmanuel Lesueur  -   elesueur@ens-lyon.fr
  52.  
  53.  
  54.