I am building the following code (I can only give a snippet here), and I am seeing the error I show after the code snippet. The code builds fine with the MS VS 2005.
I am assuming this code violates something in the C++ standard. I have been trying to reproduce the error by rewriting the line that throws the error without using the typedefs. I cannot seem to reproduce this. I expect I do not understand the typedefs well enough.
Can anyone help?
Here is the code:
// From included code:
typedef long (EventHandler::*EventHandlerFunc)(void *);
struct COMMON_EXPORT_CLASS EventID
EventID(unsigned int i_code, EventHandlerFunc i_func);
unsigned int d_code;
typedef long (VelocityManager::*Localhandler)(void*);
EventProc_NS::EventID g_events_VelocityManager =
// What does this expand to because of the typedefs above?
// I cannot recreate it without the typedefs.
// **** The following line throws the error:
EventProc_NS::EventID(0, 0) //sentinel
Here is the error the Intel compiler throws:
1>Compiling with Intel C++ Compiler 11.1.068 [IA-32]... (Intel C++ Environment)
1>Intel C++ Compiler for applications running on IA-32, Version 11.1 Build 20090930 Package ID: composer_update2_revised.068
1>Copyright (C) 1985-2009 Intel Corporation. All rights reserved.
1>.\VelocityManager_mini_version.cpp(103): internal error: type_pointed_to: not a pointer type
1> EventProc_NS::EventID g_events_VelocityManager =
1>compilation aborted for .\VelocityManager_mini_version.cpp (code 4)
-- end --
Here is small and complete example that brings the same "internal error: type_pointed_to: not a pointer type":
It would be great if Intel compiler said something more explicable than"internal error: type_pointed_to: not a pointer type"
Ok, I got some explaination from our compiler engineer.
the double cast inside "foo()" is not so good. if changing to
(aFunc)&B::b; // both icl/cl will give compile-time error
Although the above code compiles ok with cl, but it's questionable if the binary will run correctly all the time. But icl should not give "Internal Error" and we will fix that. Once that is fixed, I'll post another update here.
I would like just to clarify, that I prepared this code snippet on the base of a real program that works well being compiled by cl.
Also you can verify that the code is compiled without errors with gcc.