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

  1. Path: sparky!uunet!crdgw1!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!bingsuns.cc.binghamton.edu!umrigar
  2. From: umrigar@bingsuns.cc.binghamton.edu (Zerksis D. Umrigar)
  3. Newsgroups: gnu.g++.bug
  4. Subject: g++ bug
  5. Message-ID: <9212272039.AA23575@bingsuns.cc.binghamton.edu_>
  6. Date: 27 Dec 92 20:39:50 GMT
  7. Sender: gnulists@ai.mit.edu
  8. Distribution: gnu
  9. Organization: GNUs Not Usenet
  10. Lines: 34
  11. Approved: bug-g++@prep.ai.mit.edu
  12.  
  13. /* 
  14.  
  15. The following fails to compile under a unmodified gcc 2.3.2
  16. (mips-dec-ultrix4.2).  It compiles if the marked (enum) line below is
  17. commented out, or the enum initializer is changed to a sizeof(void *).  The
  18. compilation log is shown after the program.
  19.  
  20. */
  21.  
  22. class X {
  23.   struct X1;
  24.   enum { A= sizeof(X1 *) };    //Causes a problem.
  25.   struct X1 { int i; };
  26.   X1 *f(X1 *);
  27. public:  
  28.   X(void);
  29. };
  30.  
  31. X::X1 *X::f(X1 *x) {
  32.   return x;
  33. }
  34.  
  35. /* COMPILATION LOG
  36. gcc -c t2.cc
  37. t2.cc:19: argument list for `f' does not match any in class
  38. t2.cc: In method `struct X::X1* X::f (struct X::X1*)':
  39. t2.cc:20: type `X1' is not a base type for type `X1'
  40. t2.cc:21: warning: control reaches end of non-void function
  41.  
  42. Compilation exited abnormally with code 1 at Sun Dec 27 11:59:14
  43.  
  44. -zerksis umrigar (umrigar@bingsuns.cc.binghamton.edu).
  45.  
  46. */
  47.