home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / gnu / g / bug / 2339 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.6 KB  |  55 lines

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!world.std.com!gparker
  2. From: gparker@world.std.com (Glenn P Parker)
  3. Newsgroups: gnu.g++.bug
  4. Subject: gcc bug
  5. Date: 25 Jan 1993 21:29:34 -0500
  6. Organization: GNUs Not Usenet
  7. Lines: 41
  8. Sender: daemon@cis.ohio-state.edu
  9. Approved: bug-g++@prep.ai.mit.edu
  10. Distribution: gnu
  11. Message-ID: <199301260141.AA13906@world.std.com>
  12. Reply-To: <gparker@world.std.com> (Glenn Parker)
  13.  
  14. Submitted on behalf of Nickolay Yatsenko at Software Emancipation
  15. Technology, Inc., Waltham, MA.
  16.  
  17. Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
  18. gcc version 2.3.3
  19.  /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix fn_call2.C /usr/tmp/cca25955.i
  20. GNU CPP version 2.3.3 (sparc)
  21.  /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cc1plus /usr/tmp/cca25955.i -quiet -dumpbase fn_call2.cc -version -o /usr/tmp/cca25955.s
  22. GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
  23. fn_call2.C: In function `int  main ()':
  24. fn_call2.C:33: bad argument 0 for function `T::T (int)' (type was struct U)
  25.  
  26. // From ARM 5.2.2: 
  27. // Assignments to non-const reference parameter where the 
  28. // actual arg required a conversion.
  29.  
  30. struct T {
  31.     int a;
  32.     T(int aa) : a(aa) {}
  33. };
  34.  
  35. struct U {
  36.     int a;
  37.     U(int aa) : a(aa) {}
  38.     operator T() { return T(a); }
  39. };
  40.  
  41. void f_constT(const T & t)
  42. {
  43.   int i = t.a + 1;
  44. }
  45.  
  46. int main(void)
  47. {
  48.   U u(0);
  49.   f_constT(u);  // g++ cannot compile it, though cfront 2.1 and 3.0 can.
  50.  
  51.   return 0;
  52. }
  53.  
  54.  
  55.