"C1001 Internal Compiler Error" Error Message When You Compile a Template Method That Does Not Have a Return Type (829604)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Common Language Runtime (included with the .NET Framework 1.1)
SYMPTOMSIn Microsoft Visual C++ .NET 2003, if you implement a template
method without specifying the return type, you receive the following error message from the Microsoft C/C++
Compiler (Cl.exe) when you try to compile
your code: fatal error C1001: INTERNAL
COMPILER ERROR (compiler file 'msc1.cpp', line 2701) Please choose the
Technical Support command on the Visual C++ Help menu, or open the Technical
Support help file for more information RESOLUTIONTo resolve this problem, specify the return type when you
implement your template method. To do this, use code that is similar
to the following modified code. Note The following code is based on the sample that appears in the "More
Information" section of this article. Therefore, this code may be different from your
code. template <class T, class S>
class tExample
{
public:
void fun1(void);
void fun2(void);
};
template <class T, class S>
// To resolve C1001: INTERNAL COMPILER ERROR,
// add void as the return type to match the function prototype.
void tExample<T, S>::fun1(void)
{
}
template <class T, class S>
// To resolve C1001: INTERNAL COMPILER ERROR,
// add void as the return type to match the function prototype.
void tExample<T, S>::fun2(void)
{
}
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section of this article.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbfix kbCompiler kbProgramming kberrmsg kbcode kbbug KB829604 kbAudDeveloper |
---|
|