home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / g / bug / 2086 < prev    next >
Encoding:
Text File  |  1992-12-29  |  2.0 KB  |  82 lines

  1. Newsgroups: gnu.g++.bug
  2. Path: sparky!uunet!usc!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!icsi.berkeley.edu!krste
  3. From: krste@icsi.berkeley.edu (Krste Asanovic)
  4. Subject: same bug
  5. Message-ID: <9212281836.AA05898@icsib43.ICSI.Berkeley.EDU>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 28 Dec 1992 18:36:25 GMT
  10. Approved: bug-g++@prep.ai.mit.edu
  11. Lines: 69
  12.  
  13. This still didn't get fixed in 2.3.3. (works in 2.2.2).
  14.  
  15. On a Sparcstation-2 running SunOS 4.1.1.
  16.  
  17. Krste Asanovic,                   Computer Science Division, 
  18. email: krste@cs.berkeley.edu      c/o 571 Evans Hall
  19. phone: +1 (510) 642-4274 ext 143  University of California at Berkeley
  20. fax:   +1 (510) 643-7684          CA 94720, USA
  21.  
  22. session transcript:
  23. --------------------------------------------------------------------
  24. icsib43:20Nov92>cat main.cc
  25. template<class T>
  26. class Vec
  27. {
  28. public:
  29.     Vec(int nElements);
  30.     ~Vec();
  31.  
  32.     int size();
  33.  
  34. protected:
  35.     int n;
  36.     T *p;
  37. };
  38.  
  39. template<class T>
  40. inline
  41. Vec<T>::Vec(int nElements)
  42.   : n(nElements)
  43. {
  44.     p = new T[nElements];
  45. }
  46.  
  47. template<class T>
  48. inline
  49. Vec<T>::~Vec()
  50. {
  51.     delete[] p;
  52. }
  53.  
  54. template<class T>
  55. inline int
  56. Vec<T>::size()
  57. {
  58.     return n;
  59. }
  60.  
  61. main()
  62. {
  63.     Vec<int> a(3);
  64.  
  65.     return 0;
  66. }
  67. icsib43:20Nov92>gcc -v -c main.cc
  68. Reading specs from /usr/local/lib/gcc/sun4/2.3.3/specs
  69. gcc version 2.3.3
  70.  /usr/local/lib/gcc/sun4/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 main.cc /tmp/cca05883.i
  71. GNU CPP version 2.3.3 (sparc)
  72.  /usr/local/lib/gcc/sun4/2.3.3/cc1plus /tmp/cca05883.i -quiet -dumpbase main.cc -version -o /tmp/cca05883.s
  73. GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
  74. main.cc: In function `int  main ()':
  75. main.cc:13: inconsistent return types for method `Vec' in class `Vec<int>'
  76. main.cc: In method `Vec<int>::~Vec ()':
  77. main.cc:28: Internal compiler error.
  78. main.cc:28: Please report this to `bug-g++@prep.ai.mit.edu'.
  79. icsib43:20Nov92>
  80.  
  81.  
  82.