
Bug in VC4.2 template support: is there VC4.2.1 ???
Hi!
I have found a {*filter*} bug from MS VC 4.2. template support: if name of a
template is abc and another template is defined after and it contains a method
called abc, then the compiler thinks that the 'abc' is a template, not a
method. The same code compiles correctly with Sun, Microtec and Gnu
compilers!!!
Is there any newer version of the compiler available (e.g. 4.2.1). I know
that VC 5.0 is available, but it works only in Windows NT 4.0 and I am using
3.51.
The following file demonstrates the problem.
Greetings,
Jukka Kemppainen
// this file demonstrates problem with template support of MS VC 4.2 compiler
//
// The file compiles without errors with following compilers:
// 1) Sun C++ compiler : CC setbug.cpp
// 2) Microtec C++ compiler : ccc68k setbug.cpp
// 3) GNU C++ compiler : gcc setbug.cpp
//
// The MS VC 4.2 produces following error messages:
//
// [c:\]cl setbug.cpp
// Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 10.20.6166 for 80x86
// Copyright (C) Microsoft Corp 1984-1996. All rights reserved.
//
// setbug.cpp
// setbug.cpp(31) : error C2955: 'set' : class template name expecting
// parameter list
// setbug.cpp(31) : error C2027: use of undefined type
// 'mytemplate<`template-parameter-1'>'
// setbug.cpp(34) : error C2997: 'set' : function parameter list must use
// template parameter 'T'
template <class Key, class Compare>
class set {
public:
Quote:
};
template <class T>
class mytemplate
{
public:
void set( int data );
Quote:
};
template <class T> // line #31
void mytemplate<T>::set( int data )
{
Quote:
} // line #34
int main()
{
mytemplate<int> x;
x.set(1);
return 0;
Quote:
}