Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Polymorphic functions are not recognized by indexer(Polymorphic functions are not recognized by indexer)
Polymorphic functions are not recognized by indexer [message #876865] Fri, 25 May 2012 12:11 Go to next message
serafim papapanagiotou is currently offline serafim papapanagiotouFriend
Messages: 3
Registered: May 2012
Junior Member
I have a base pointer initialized with a derived class

Base* ptr = new Derived();
ptr->foo(); (foo is a virtual function. Exists in both classes)


Surprisingly eclispe code navigation doesn't open the Derived class foo() function but rather the foo() from Base class.

Any suggestion how to make indexer to work for this ?


Re: Polymorphic functions are not recognized by indexer [message #877024 is a reply to message #876865] Fri, 25 May 2012 18:33 Go to previous messageGo to next message
serafim papapanagiotou is currently offline serafim papapanagiotouFriend
Messages: 3
Registered: May 2012
Junior Member
In order to make the above more clear...Trying to do some code navigation and I select the ptr->foo() function while pressing F3 instead of going to foo() of the derived class I am going to the foo() of the basic class.

I imagine for sure somebody has encountered such an issue since this is just basic polymorphism. Any idea how to have the correct display for this ?
Re: Polymorphic functions are not recognized by indexer [message #877050 is a reply to message #877024] Fri, 25 May 2012 19:43 Go to previous messageGo to next message
Yevgeny Shifrin is currently offline Yevgeny ShifrinFriend
Messages: 208
Registered: July 2009
Senior Member
Hi,

I checked java behavior and it behaves as CDT. You are expecting from CDT indexer too much Smile

How would you expect it to behave in use case below?

Base* ptr = new Base();

if (condition)
{
ptr = new Derived();
}

ptr->foo();


Thanks,
Yevgeny
Re: Polymorphic functions are not recognized by indexer [message #877216 is a reply to message #877050] Sat, 26 May 2012 05:31 Go to previous messageGo to next message
serafim papapanagiotou is currently offline serafim papapanagiotouFriend
Messages: 3
Registered: May 2012
Junior Member
All source navigators gives you the option to select which one you want to call. They don't really take you to Derived class foo() function but a prompt box is opening and they are asking you ...Derived:foo or Base:foo ?

Since this is quite basic (at least I have seen it in many IDEs) I am wondering whether this is a configuration issue in eclipse for C++
Re: Polymorphic functions are not recognized by indexer [message #877237 is a reply to message #877216] Sat, 26 May 2012 06:59 Go to previous message
Nobody Mising name is currently offline Nobody Mising nameFriend
Messages: 75
Registered: July 2010
Member
This navigation to virtual function is a lot better in CDT than in Visual Studio/Visual Assist. Just press Ctrl+T to watch the hierarchy of types that overload this virtual function.
Previous Topic:How to compile a VisualDSP project in eclipse ?
Next Topic:Can't resolve #include <stdio.h> in Windows XP Pro
Goto Forum:
  


Current Time: Thu Apr 25 13:00:36 GMT 2024

Powered by FUDForum. Page generated in 0.03091 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top