Hi,
I'm using MS VC 6.0.
The compiler has a fatal error on the program below.
If the destructor is removed, the compilation succeeded.
Does anyone have an idea why?
Is it a correct C++ program?
Thanks,
Erez.
The Program:
------------
class Cl {
public:
~Cl();
};
Cl::~Cl(){
}
Cl getCl() {
return Cl();
}
void main() {
static Cl &cl = getCl(); // Simplified version which cause the fatal error
//static ClBase &clBase = getCl(); // The real case. Cl derived from ClBase
}
The compiler output:
---------------------
Compiling...
testRef1.cpp
fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'E:\8966\vc98\p2\src\P2\main.c', line 494)
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.
testRef1.exe - 1 error(s), 0 warning(s)