This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

bug in "pure virtual" templates ?


Hi,

I accidentaly mixed up some code, which resulted in something like this:

34 class Test
35 {
36 public:
37     template<class T> T get( void ) = 0;
38 };

which compiled with 3.3.5 20050117 and 4.0.2 20050720 where I think it
shouldn't.
Playing around with this piece of code, I changed the "= 0" to "= 1" and
3.3.5 reported (more or less, since the function isnt virutal)
correctly:
test.cpp:37: error: invalid initializer for virtual method `T
Test::get()'
while the 4.0.2 says:
test.cpp:37: internal compiler error: in grokfield, at cp/decl2.c:910

Sorry if this has been reported before, after searching for half an hour
I couldn't find anything like that...

greets

Dennis
-- 
Dennis Lubert <plasmahh@tzi.de>



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