Strangeness with G++ 3.0.2 and typedefs

Ken Shiring kenshir@us.ibm.com
Tue Jan 8 10:44:00 GMT 2002


Hello all, I am hoping that someone on this list can help me with the 
following problem.  The following code snippet will compile properly 
under G++ 2.95.2 :

#include <stdio.h>
#include <vector>

typedef vector<int> vecint_t;

int main(int argc, char** argv)
{
	return(0);
}


The problem lies in the typedef of the template (the main function is 
just there so the compiler actually has something to compile). Under G++ 
3.0.2, G++ says :

ktest.C:4: syntax error before `;' token
make: *** [obj/ktest.o] Error 1


Why is G++ 3.0.2 complaining?  This is legitmate ISO C++ is it not?

-- 
Ken Shiring

IBM Corporation
PEPS Embedded PowerPC design group
Research Triangle Park, NC



More information about the Gcc-help mailing list