internal compile error

V

Vasco Lohrenscheit

Hello,

with following example:


//main.cpp
#include <string>
using std::string;

struct iFactory {
virtual void create(void** o)=0;
};
template <typename TYPE> struct Factory : public iFactory {
Factory(){}
virtual void create(void** o) {*o = new TYPE();}
};
struct tFactoryMap {string ID; iFactory* factory;};
class Foo {
void test(){}
};
tFactoryMap fmap[] = { {"Foo",new Factory<Foo>()} };

int main () {
return 0;
}



i get an internal compiler error:

fatal error C1001: INTERNER COMPILERFEHLER (Compilerdatei
'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\ehexcept.c', Zeile 908)


The problem causes the Constructor Factory::Factory(), if i comment the
constructor out everything compiles without error.

This is valid c++ code, isn't it ? Or could be the constructor/new in
the initializing list for fmap be illegal ? Anyway, the compiler should
give a more meaningful messag :)

Where can such bugs be reported ?


btw: I'm using vc7.1 from visual studio .net 2003. Any hints when a
first service pack will be available, i get from time to time crashes of
the IDE (mostly while debugging) and occasional an internal compiler error.

best regards,

Vasco
 
C

Carl Daniel [VC++ MVP]

Vasco said:
Hello,

with following example:
[snip]

i get an internal compiler error:

fatal error C1001: INTERNER COMPILERFEHLER (Compilerdatei
'f:\vs70builds\3077\vc\Compiler\Utc\src\P2\ehexcept.c', Zeile 908)


The problem causes the Constructor Factory::Factory(), if i comment
the constructor out everything compiles without error.

This is valid c++ code, isn't it ?

Yes, it is - as far as I can see anyway. Comeau likes it too.
Or could be the constructor/new in
the initializing list for fmap be illegal ?

AFIAK, it's legal, but it is the source of confusion for the compiler.

Re-writing the code as:

Factory<Foo> fFoo;

tFactoryMap fmap[] =
{
{ "Foo", &fFoo }
};

gets around the ICE.
Anyway, the compiler
should give a more meaningful messag :)

Unforutnately, there's not much more it can report in the case of an ICE,
since by definition it's a situation that wasn't (properly) desgined-for in
the compiler.
Where can such bugs be reported ?

Consider it reported.
btw: I'm using vc7.1 from visual studio .net 2003. Any hints when a
first service pack will be available, i get from time to time crashes
of the IDE (mostly while debugging) and occasional an internal
compiler error.

There's been no indication that a service pack for VC7.1 will be forthcoming
anytime soon. This ICE also occurs with the current "VC8" alpha version of
the compiler - I'll submit a bug report to the alpha for this bug so it
might be fixed in "VC8".

-cd
 
M

Mitchell Slep [MSFT]

Hello Vasco,

We are currently investigating this issue. Thank you for reporting it.

Mitchell Slep
Visual C++ team

--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top