Sign in to follow this  

fatal error - compiler error

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Try and compile this on VC++ 6. This is the essence of some code I was writing, and I had forgotten to add the template to the inheritance part of inheriting from class A. Being a good little boy, I had everything properly encapsulated within namespaces.
namespace hello{

template <class T>
class A
{
public:
	int a;
};

}// namespace hello


class B	:	public hello::A
{
public:
	int b;
};

int main()
{

return 0;
}



Answer me this: why is it that if I get rid of the namespace I get a nice "class A is a template class!" error message, but if I put the namespaces in I get:
--------------------Configuration: test code - Win32 Debug--------------------
Compiling...
test code.cpp
C:\Documents and Settings\Naim\My Documents\Programming\everything\test code\test code.cpp(25) : fatal error C1001:
			 INTERNAL COMPILER ERROR
        (compiler file 'msc1.cpp', line 1786) 
         Please choose the Technical Support command on the Visual C++ 
         Help menu, or open the Technical Support help file for more information
Error executing cl.exe.

test code.exe - 1 error(s), 0 warning(s)
That? Why does the namespace cause such an error? Is it simply because VC++ 6 is really really broken?

Share this post


Link to post
Share on other sites
The code above should return error error C2955: 'hello::A' : use of class template requires template argument list. I'll try this in VS 2003.

[Edit]: In VS 2003 I've got no INTERNAL COMPILER ERROR.

Share this post


Link to post
Share on other sites
It's really strange. I only get the internal compiler error if I have the namespaces in. Take them out, perfectly legit "'A' : use of class template requires template argument list"

Isn't that just strange?

Share this post


Link to post
Share on other sites
It is not. That's why you've got VS 2003 and now VS 2005 published. I've crushed with some stranger behaviors of VS6: In the same Debug build, the program behaves differently when I run it from Visual Studio environment and when I run it from outside (by command line or Windows Explorer) with the same set of input.

Share this post


Link to post
Share on other sites

This topic is 4356 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this