FIX: "C1001 Internal Compiler" Error Message When You Compile Code with Typename Identifier (315490)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2002)

This article was previously published under Q315490

SYMPTOMS

When you try to compile the sample code fragment from the "More Information" section of this article, you receive the following compiler error message:
t.cpp(16) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2844)

CAUSE

This behavior occurs if a template class contains a derived member method as a typename identifier. The compiler error message occurs only when you compile the code in a Managed C++ project. You do not receive this error message when you use a native code compiler.

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 Microsoft Visual C++ .NET (2003).

MORE INFORMATION

Steps to Reproduce the Problem

  1. Create a new Managed C++ application, and then replace the default code with the following:
    #include "stdafx.h"
    
    class A {
    public:
    	void FA();
    	int i;
    };
    
    class B : public A {
    public:
    	virtual void FB();
    	int k;
    };
    
    template <typename F, const F pF>
    class CLockFunc0 {
    public:
    	CLockFunc0() : m_pF(pF) {}
    	~CLockFunc0() {}
    private:
    	F m_pF;
    };
    
    CLockFunc0<void (B::*)(), B::FB> t1;
    					
  2. Compile the program. You receive the error message described in the "Symptoms" section of this article.

Modification Type:MajorLast Reviewed:4/11/2003
Keywords:kbfix kbbug kbCompiler kberrmsg kbManaged kbpending KB315490