This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

name resolutions bug


Hi,

I believe i found a bug...
In compiling with:
gcc version egcs-2.90.23 980102 (egcs-1.0.1 release)

and with this code:
----start:----
enum TestEnum { First, Second, Third };

class TestClass
{
public:
        TestClass();

        void Second();

private:
TestEnum
        myVar;
}

inline TestClass::TestClass()
{                               //this is line 16
 myVar = Second;                //this is line 17
}
----:end----

I get these errors:
testcase.cc:16: return type specification for constructor invalid
testcase.cc: In method `TestClass::TestClass()':
testcase.cc:17: warning: assuming & on `TestClass::Second()'
testcase.cc:17: assignment to `TestEnum' from `void (TestClass::*)()'


I'm not sure about the first (line 16).... i just saw that when i made 
this
testcase, but on the second(line 17), it seems to me that the compiler
(egcs, and i've also tested it on g++ 2.8.0) is not name resolving
properly, i would think that there should at least be an warning
that the names declared in the Enum are the same as used by the class.

Thanks,

Ryan

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

testcase_cc







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]