[cfe-dev] Getting the fully scoped type of a function parameter

Pascal Ognibene pognibene at gmail.com
Wed Nov 14 03:13:05 PST 2012


Hi all,

I have a clang::ParmVarDecl argument of a C++ function/method.
I need to retrieve the fully scoped type of this argument. For example:

namespace foo
{
   typedef struct
   {
      int bla;
   } oneStruct;
}

...

namespace foo
{
    int one_function(oneStruct *arg);
};

When I get the clang::FunctionDecl * for one_function, I then get a
ParmVarDecl * for arg.
To get the type I can use one of the QualType type =
ParmVarDecl::get*Type() functions.
However, when I get the type as a string, it's oneStruct * and not
foo:oneStruct *

How can I get the fully scoped name of this parameter? (using clang 3.1)

Thank you for your help!

Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20121114/96dbd99e/attachment.html>


More information about the cfe-dev mailing list