Compiler misbehavior and internal compiler error
While messing around with some metaprogramming stuff, I have just found out that writing this:
//***********************************
enum E
{
value = 0,
};
int _tmain(int argc, _TCHAR* argv[])
{
typedef void (E::* pEnumMember) (int);
}
//***********************************
The compiler does not say a word and compiles fine. If then you go on and do something like this:
//***********************************
enum E
{
value = 0,
};
struct S
{
void Function(int) {int a = 43;};
};
int _tmain(int argc, _TCHAR* argv[])
{
typedef void (E::* pEnumMember) (int);
pEnumMember p = reinterpret_cast<pEnumMember>(&S::Function);//upps
}
//***********************************
you get an internal compiler error.
fatal error C1001: An internal error has occurred in the compiler. (compiler file 'msc1.cpp', line 1392)
Thanks for your time.

