BUG: C1001 error occurs while accessing a property by using a smart pointer in a struct member (823929)
The information in this article applies to:
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ .NET (2002)
SYMPTOMSWhen you access a property through a smart pointer for a
struct member, you may receive the following internal compiler
error message: fatal error C1001: INTERNAL COMPILER
ERROR (compiler file
'f:\vs70builds\9466\vc\Compiler\CxxFE\sl\P1\C\toil.c', line 7021)
Note The file name, the full path, and the line number may vary with
the compiler build that you use. WORKAROUNDTo work around this bug, copy the contents of the property that
are accessed by a smart pointer to a temporary variable, and then use the copied
value in a struct member. The following is the modified code:
#import "TestServer.dll" no_namespace
void main() {
CoInitialize(NULL);
IPtr p(__uuidof(C));
struct s {
int number;
wchar_t* string;
};
wchar_t* str1 = p->a;
wchar_t* str2 = p->b;
s impl[2] = {
{0, str1},
{1, str2}
};
p = 0;
CoUninitialize();
}
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 1/18/2006 |
---|
Keywords: | kberrmsg kbSmartPtr kbCompiler kbbug KB823929 kbAudDeveloper |
---|
|