Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think!huxley!glenn From: glenn@bitstream.com (Glenn P. Parker) Newsgroups: comp.lang.c++ Subject: Re: inline member functions returning a enumerated type Message-ID: Date: 26 Jul 90 21:07:01 GMT References: <1851@island.uu.net> Sender: glenn@huxley.UUCP Reply-To: (Glenn Parker) Organization: Bitstream, Inc. Lines: 31 In-reply-to: chris@island.uu.net's message of 23 Jul 90 17:31:47 GMT In article <1851@island.uu.net> chris@island.uu.net (Chris King) writes: > I could use some help figuring out a problem I am having with > defining a inline member function that returns a enum. I don't > ... > struct test { > enum id { A, B, C }; > > enum id v; > > test() { v = A; } > inline enum id GetV() { return v; } ^^^^^^ > }; > ... > "TestClass.cc", line 8: error: bad base type: inline enum id Apollo C++ 2.0 gives the same error, if that's any comfort. Removing the indicated "inline", which is superfluous (but certainly not illegal), makes the error go away. The function will still be inlined, because it is declared within the struct definition. Alternatively, removing the "enum" following the indicated "inline" will _also_ make the error go away. Again, the enum is superfluous (but not illegal, I think), since "id" is sufficient to identify the type of the function. Looks like a compiler bug to me, but nothing too serious. -- -------------------------------------------------------------------------- Glenn P. Parker Bitstream, Inc. uunet!huxley!glenn 215 First Street glenn@bitstream.com Cambridge, MA 02142-1270