BUG: C1001: Internal Compiler Error in Template.cpp File, Line 6514ID: Q236099
|
When compiling code that uses templates and contains a mismatched number of parameters between the declaration and implementation of the template classes, the compiler may give the following error:
The line number is 6529 if you have installed Visual Studio 6.0 Service Pack 3 (SP3).fatal error C1001: INTERNAL COMPILER ERROR (compiler file '.\template.cpp', line 6514)
The compiler failed to correctly parse the code and was unable to generate a syntax error message.
Check the number of parameters in the declaration and implementation of the template classes. Correct the code so that the parameters match.
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.
The following code demonstrates the bug:
template <class T, bool bArray = false>
class Test
{
public:
Test(T *p);
T* _p;
};
template <class T> // Comment this line and uncomment
// the next line for fix.
//template <class T, bool bArray>
inline Test<T>::Test<T>(T *p)
{
_p = p;
}
void main()
{
Test<int, false> pInt = new int;
}
Additional query words:
Keywords : kbCompiler kbVC600bug kbDSupport kbGrpVCCompiler
Version : winnt:6.0
Platform : winnt
Issue type : kbbug
Last Reviewed: July 21, 1999