Microsoft KB Archive/236099

= FIX: C1001: Internal Compiler Error in Template.cpp File, Line 6514 =

Article ID: 236099

Article Last Modified on 11/18/2003

-

APPLIES TO


 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition

-



This article was previously published under Q236099



SYMPTOMS
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:

fatal error C1001: INTERNAL COMPILER ERROR (compiler file '.\template.cpp', line 6514)

The line number is 6529 if you have installed Visual Studio 6.0 Service Pack 3 (SP3).



CAUSE
The compiler failed to correctly parse the code and was unable to generate a syntax error message.



RESOLUTION
Check the number of parameters in the declaration and implementation of the template classes. Correct the code so that the parameters match.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This problem was corrected in Microsoft Visual C++ .NET.



MORE INFORMATION
The following code demonstrates the bug: template  class Test { public: Test(T *p); T* _p; };

template                // Comment this line and uncomment // the next line for fix. //template 

inline Test::Test(T *p) {  _p = p; }

void main {  Test pInt = new int; }

Keywords: kbbug kbfix kbnoupdate kbcompiler KB236099

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.