Cedet multiple indirection to definition via typedef results in no completion

"Dixon Ryan (ETAS/ESW6)" <[email protected]> Wed, 19 Nov 2014 11:53:09 +0000
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
Hi all,

Firstly I sent this to stackoverflow and Alex suggested sending this to the mailing list. The first part is the stackoverflow, the 2nd part is a project ready-made to prove the bug (or lack of feature):

------------------------------STACKOVERFLOW------------------------------------------

Pretend I have an emacs window open and it is split horizontally  into three buffers:
    ===== BUFFER1.cpp ======  << buffer 1
    #include "CommonTypeDefs.h"
    namespace NS1 {
    ...
    void someFunction( void ) {
      MyClassHandle mh = getMyClassHandle(); // getMyClassHandle(): returns a MyClassHandle
      mh-> // SEMANTIC does not parse
    ...

    ===== CommonTypeDefs.h   ====== << buffer 2
    ...
    typedef class NS2::MyClass* MyClassHandle
    ...

        ===== BUFFER2.h   ====== << buffer 3
        namespace NS2 {
    ...
    class MyClass {
      // things in here
    ...

-
I do not see why this extra layer (in this case a common header file full of typedefs) is not picking up the possible completions.
-
I have also noticed that when Semantic works I get shown the line of the class definition, eg:
-
    ===== BUFFER1.h   ======
    SomeDe[]finedClass* sdc = getSomeDefinedClassPtr();
-
If I have the cursor over the type that is sdc (see the square braces), the Emacs minibuffer will say something
like:
-
   SomeDefinedClass.h: class SomeDefinedClass {}
-

This means that I know Semantic will be able to parse the symbos in SomeDefinedClass. Everything is good when this happens because there is no typedef involved. But, in the case where things don't work:
-
    ===== BUFFER1.h   ======
    SomeDe[]finedClassHandle sdch = getSomeDefinedClassHandle();
-

Again, I have the cursor where the square brackets are but this time the minibuffer says:
-
    CommonTypeDefs.h: typedef* SomeDefinedClassHandle {}
-

I guess this makes sense, because firstly this type is a typedef, but it seems like Semantic stops there - rather than then saying, Okay: I am a typedef, but now I need to look at symbols for the typedef. Hence, I do not get completions.
-
I have confirmed that everything has been parsed because I have *-decoration-mode* on. Also, semantic is working for other things, it just doesn't seem to be able to handle these handles.
There is no problem with missing includes either as there are no compilation errors. In this project there are a number of subsystems, hence why I have included different directory to the system-c-dependency-include* path and these all work fine.
Why is this not working?

Emacs 24.3 / Windows / CEDET (around the 26th Sept 2014 bzr release)

------------------------------END OF STACKOVERFLOW------------------------------------------

Now, here are some project files that I have created that prove this:

Environment: Emacs 24.3 / Windows / MSYS G++ (if you need to know version I can give) / CEDET BZR version released on 24th Sept (approx)

The files and their contents: (PS: This has changed a little bit compared to StackOver*, but even without NS1 the bug remains. Also things like the Makefile are just not needed for this, but I will send over everything anyway):

===BUFFER1.cpp===
#include "CommonTypeDefs.h"
#include "BUFFER2.h"

MyClassHandle getMyClassHandle() {
   MyClassHandle mc = new NS2::MyClass();

   return mc;
}

void deleteMyClassHandle(MyClassHandle ptr) {
   delete ptr;
}

int main ( void ) {
   MyClassHandle mch = getMyClassHandle();

   NS2::MyClass* mcptr = getMyClassHandle();

   // mch-> //does not work

   // mcptr-> // does work

   deleteMyClassHandle(mch);
   return 0;
}
===END OF BUFFER1.cpp===

===BUFFER2.h===
#ifndef _BUFFER_H_
#define _BUFFER_H_

namespace NS2 {
   class MyClass {
   public:
      void myFunction() { }
   };
};
#endif /* _BUFFER_H_ */
===END OF BUFFER1.cpp===

===CommonTypeDefs.h===
#include "BUFFER2.h"

typedef class NS2::MyClass* MyClassHandle;
===END OF CommonTypeDefs.h===

===Makefile===
all:
                g++ -o output BUFFER1.cpp
===END OF MAKEFILE===

make all

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk

_______________________________________________
cedet-semantic mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-semantic