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]

template map value_type bug


	Given:

		#include <map>

		template< class T > class C : map< int, T > {
			key_type k;
			value_type v;	// line 5
		}

	one gets:

		$ g++ bug.c
		bug.c:5: syntax error before ';'

	because "value_type" is not recognized as a type even though
	"key_type" is.  A declaration of C without using any templates
	at all compiles correctly.

	See attached for compiler info.

	- Paul


Reading specs from /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release/franzo)
 /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -DPPC -D__ELF__ -Dpowerpc -D__PPC__ -D__ELF__ -D__powerpc__ -D__PPC -D__powerpc -Acpu(powerpc) -Amachine(powerpc) -D__EXCEPTIONS -D__CHAR_UNSIGNED__ -D_CALL_SYSV -D_BIG_ENDIAN -D__BIG_ENDIAN__ -Amachine(bigendian) -D_ARCH_PPC -D__unix__ -D__linux__ -Dunix -Dlinux -Asystem(unix) -Asystem(posix) bug.c /tmp/cc4mOGDu.ii
GNU CPP version 2.95.2 19991024 (release/franzo) (PowerPC GNU/Linux)
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/../../../../include/g++-3
 /usr/local/include
 /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/include
 /usr/include
End of search list.
The following default directories have been omitted from the search path:
 /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/../../../../ppc-yellowdog-linux/include
End of omitted list.
 /usr/lib/gcc-lib/ppc-yellowdog-linux/2.95.2/cc1plus /tmp/cc4mOGDu.ii -quiet -dumpbase bug.cc -version -o /tmp/cccBtn1T.s
GNU C++ version 2.95.2 19991024 (release/franzo) (ppc-yellowdog-linux) compiled by GNU C version 2.95.2 19991024 (release/franzo).
bug.c:5: syntax error before `;'


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