C1001 error when you compile source code that contains the ternary operator (?:) in Visual C++

Article translations Article translations
Article ID: 216715 - View products that this article applies to.
This article was previously published under Q216715
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

On This Page

SYMPTOMS

When compiling source code containing the ternary operator (?:), if the compiler converts one of the operands from one class type to another, incorrect code may be generated or you might receive the following error message:
fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'E:\8168\vc98\p2\src\P2\ehexcept.c', line 577)

STATUS

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

This bug was corrected in Visual Studio 6.0 Service Pack 3. For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:
194022 Visual Studio 6.0 service packs, what, where, why
194295 How To Tell That a Visual Studio Service Pack Is Installed

MORE INFORMATION

Steps to Reproduce Behavior

#include <afx.h>
class F
{
	char m_str[50];
	CString cstr;
public:
	F(char *str)
	{
		strcpy(m_str, str);
		cstr = "CSTRING";
	}
	operator CString() 
	{
		cstr = m_str;
		return cstr;
	}
};

void H( const CString & state)
{
	F f("test");
	CString str;
	str = (state != "off") ? state : f;
}
				

Properties

Article ID: 216715 - Last Review: February 21, 2014 - Revision: 3.1
APPLIES TO
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
Keywords: 
kbnosurvey kbarchive kberrmsg kbbug kbfix kbvc600fix kbcpponly kbcompiler kbvs600sp3fix KB216715

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com