[cfe-dev] Question about finding underlying type for auto vardecls using public C api

Anders Bakken agbakken at gmail.com
Wed Apr 8 14:37:35 PDT 2015


Is there an example showing how to do this? I've tried to piece something
together to do it but it doesn't work correctly and is a terrible hack.

E.g.

struct A
{
};
A getA() { return A(); }
int foo()
{
     A a;
     auto b = a;
     auto c = getA();
     auto d = A();
     auto *e = new A();
}

I would like to make a function that could return the CXCursor for A for
all of these vardecls (b, c, d and e).

The code I have is here:

https://github.com/Andersbakken/rtags/blob/master/src/RTagsClang.cpp

Starting at line 232 (resolveAutoTypeRef).

best regards and thanks for a wonderful library.

Anders
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150408/04981feb/attachment.html>


More information about the cfe-dev mailing list