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

  1. Path: sparky!uunet!UB.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!world.std.com!kol
  2. From: kol@world.std.com (Nikolay Yatsenko)
  3. Newsgroups: gnu.g++.bug
  4. Subject: g++ bug
  5. Date: 28 Jan 1993 22:14:28 -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: <199301272139.AA25483@world.std.com>
  12.  
  13. Compile error (gcc 2.3.3, sparc), inline function in nested class.
  14. Below is an example:
  15. input source file, gcc 2.3.3 compiler messages.
  16.  
  17.  
  18. /////////////////// Input file /////////////////////////////////////////
  19. // ARM 9.7 Nested Class Declaration.
  20. //
  21. // From AT&T Annotated C++ Reference Manual, 9.7:
  22. // "Except by using explicit pointers, references, and object names, 
  23. // declarations in a nested class can use only type names, static members, 
  24. // and enumerations from the enclosing class."
  25. //
  26. // This is an example from ARM $9.7. 
  27.  
  28. int x;
  29.  
  30. class enclose {
  31. public:
  32.   int x;
  33.   static int s;
  34.  
  35.   class inner {
  36.     void f(int i)
  37.       {
  38.     ::x = i; // Error: g++ gives error, should be OK: assign to global x.
  39.       }
  40.   };
  41. };
  42. ///////////////// end of input file ////////////////////////////////
  43.  
  44. Reading specs from /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/specs
  45. gcc version 2.3.3
  46.  /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 nested2.C /usr/tmp/cca26697.i
  47. GNU CPP version 2.3.3 (sparc)
  48.  /usr/local/lib/gcc-lib/sparc-sun-sunos4.1/2.3.3/cc1plus /usr/tmp/cca26697.i -quiet -dumpbase nested2.cc -version -o /usr/tmp/cca26697.s
  49. GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
  50. nested2.C:20: warning: all member functions in class `inner' are private
  51. nested2.C: In method `void  inner::f (int)':
  52. nested2.C:18: assignment to non-static member `x' of enclosing class `enclose'/
  53.  
  54.