Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7875 Discussions

Intel C++ Compiler Error (works with Visual Studio 2005 SP2 Compiler).

Todd_Bezenek
Beginner
412 Views

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?

Thank you,

Todd

Here is the code:

///////////////////////////////////

// From included code:
#if 0
typedef long (EventHandler::*EventHandlerFunc)(void *);

struct COMMON_EXPORT_CLASS EventID
{
EventID(unsigned int i_code, EventHandlerFunc i_func);
unsigned int d_code;
EventHandlerFunc d_func;
};
#endif

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(ParentChanged,
(EventProc_NS::EventHandlerFunc)(Localhandler)&VelocityManager::onToothDeleted),

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> ^
1>
1>compilation aborted for .\VelocityManager_mini_version.cpp (code 4)


-- end --

0 Kudos
5 Replies
Fedor_Chelnokov
Beginner
412 Views

Here is small and complete example that brings the same "internal error: type_pointed_to: not a pointer type":

class A;
typedef void (A::*aFunc)(void *);
aFunc ptr;
class A
{
public:
virtual ~A();
};
class C { };
class B : public A, public C
{
public:
void b(int* var);
};
typedef void (B::*bFunc)(void *);
void foo()
{
(aFunc)(bFunc)&B::b;
}

It would be great if Intel compiler said something more explicable than"internal error: type_pointed_to: not a pointer type"

0 Kudos
JenniferJ
Moderator
412 Views
Thank you for the test case!

I've submitted a bug report to the compiler team and hopefully will geta work-around. If so, I'll post it here.
Thanks again!
Jennifer
0 Kudos
JenniferJ
Moderator
412 Views
class A;
typedef void (A::*aFunc)(void *);
aFunc ptr;
class A
{
public:
virtual ~A();
};
class C { };
class B : public A, public C
{
public:
void b(int* var);
};
typedef void (B::*bFunc)(void *);
void foo()
{
(aFunc)(bFunc)&B::b;
}


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.

Thanks again!
Jennifer

0 Kudos
Fedor_Chelnokov
Beginner
412 Views


Although the above code compiles ok with cl, but it's questionable if the binary will run correctly all the time.

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.

Thanks, Fedor

0 Kudos
JenniferJ
Moderator
412 Views

Just an update. This issue is fixed in the 13.x compiler. You can find the 13.1 from our Registration center or the eval center.

Jennifer

0 Kudos
Reply