Re: Fwd: Semanticdb and code completion for std::share_ptr<obj>

Eric Ludlam <[email protected]> Sat, 2 Jan 2016 16:29:53 -0500
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
Hi Collin,

On 12/16/2015 02:27 AM, tenspd137 . wrote:
> std::shared_ptr<obj> ptr;
> ptr = std::shared_ptr<obj>(new obj())
> ptr->
>
> /C-c? or /C-c>, it says it can't find types for ptr
>
> but
>
> obj* ptr;
> ptr = new obj();
> ptr->


I built up an example using

#include <memory>,

and a class I invented, and verified that the first example didn't show 
the contents of the invented class for "obj".  I thought this should 
work, but when I looked into the shared_ptr_base.h on my linux box, 
large chunks of it, including the operator -> method were not parsable 
by the existing C++ parser, so the completion engine didn't have access 
to know to dereference the template.  I started adding some of the C++11 
new keywords like 'noexcept', etc and got more of the header files 
parsing, but there are too many things missing for a quick fix that I 
can send you.  It will have to wait for a C++ 11 update of the parser.

I tried a cheat; created my own memory header file, put a shared_ptr 
impl I found on stack exchange into it, and hacked my include path. 
After that I got the example code you are looking for to complete.

Unfortunately, that will be a lot of work.  It might be simpler to get 
copies of the header files from older versions of gcc, and point 
semantic at those instead.

Your questions about Qt may be the same.  I don't have a Qt install 
handy to know.  Sorry.

Eric

------------------------------------------------------------------------------