BUG: C1001 Error When You Use a Global Variable as a Template Argument (315948)
The information in this article applies to:
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
This article was previously published under Q315948 SYMPTOMS When you pass a reference to a global variable as a
template argument, you may receive the following compiler error (or a similar
one): repro.cpp(3): fatal error C1001: INTERNAL COMPILER
ERROR (compiler file 'f:\vs70builds\9466\vc\Compiler\Utc\src\P2\main.c', line
146) Please choose the Technical Support command on the Visual C++ Help
menu, or open the Technical Support help file for more information
You receive this error message only if you compile without using precompiled
headers. CAUSE Because of a known bug, the compiler cannot generate
correct code for a construct. In this case, the compiler cannot resolve the
global variable. RESOLUTION To work around this problem, declare the variable at global
scope, either in a separate header file, or in the global scope of the file in
which the file is referenced. STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 4/11/2003 |
---|
Keywords: | kbbug kbCompiler kbfix KB315948 |
---|
|