budd@mist.cs.orst.edu (Tim Budd) (09/01/90)
I'm running Gnu C++ version 1.37, and either I'm misunderstanding something or I have a compiler bug. In short, the compiler doesn't seem to let me use access control specifiers on operators. That is, if I have class A { public: int operator++(); }; class B : private A { public: A::operator++; }; The compiler complains with the curious message that an operator name is missing on the line ``A::op...'' in class B. My reading of Ellis and Stroustrup is that this should be legal. Which is wrong, me or GNU?
jac@sundance.llnl.gov (James Crotinger) (09/11/90)
In article <20088@orstcs.CS.ORST.EDU> budd@mist.cs.orst.edu (Tim Budd) writes: [example deleted] >The compiler complains with the curious message that an operator name is >missing on the line ``A::op...'' in class B. My reading of Ellis and >Stroustrup is that this should be legal. Which is wrong, me or GNU? I reported a similar bug on gnu.g++ some time back. The example was from some C++ 2.0 code which works on the Mac and under Sun C++, and which I'd like to compile with G++ for comparison. Roughly the example was: class Array { //.... float &operator[](int i) {...} } class User { //... static Array B(100); } User::B[5] = 6; // This generated an error. Anyway the type of error was the same...we'd overloaded an operator and later tried to use that operator on an Array which was a static member of another class, and g++ couldn't parse it. It has been awhile and can't recall the exact error (or the precise details of the code, so the above may exactly represent the problem we had). Jim -- ----------------------------------------------------------------------------- James A. Crotinger Lawrence Livermore Nat'l Lab // The above views jac@gandalf.llnl.gov P.O. Box 808; L-630 \\ // are mine and are not (415) 422-0259 Livermore CA 94550 \\/ necessarily those of LLNL.