FIX: Manipulator Causes C1001 IC Error in MSC1.CPP Line 1056 (131312)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
This article was previously published under Q131312 SYMPTOMS
The compiler generates the following compiler error:
fatal error C1001: INTERNAL COMPILER ERROR
( compiler file 'msc1.cpp', line 1056 )
This occurs when the code meets both of these conditions:
- It contains a function template that overwrites the << operator
(insertion operator) or the >> operator (extraction operator) for class
ostream. For example:
template <class T> ostream& operator<<( ostream&, T& ); //or
template <class T> istream& operator>>( istream&, T& );
- It contains an expression of the form:
iostream_specifier insertion/extraction_operator manipulator
For example:
cout << endl; // fails if template operator << was defined
cout << flush; // fails if template operator << was defined
cin >> ws; // fails if template operator >> was defined
RESOLUTION
The problem does not occur if an identifier of any type is inserted into
the expression. For example, if 'a' is a variable (of any type):
cout << a << endl; // does not fail
cout << '\n' << flush; // does not fail
cin >> a >> ws; // does not fail
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was fixed in Microsoft
Visual C++, 32-bit Edition, version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbfix KB131312 |
---|
|