[libclang] Getting unqualified version of Type

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[libclang] Getting unqualified version of Type

Artem Dergachev via cfe-dev
Is there a way to get "base" type of, well, Type. I see that it's
possible to test for const or volatile, but I don't see a way, to get
the underlying type.

What I am ultimately trying to do is to map member relationships
between classes, and currently the solution is missing some due to
type `A` being different from `const A`.

The only workaround I see is to check with
`clang_isConstQualifiedType` and parse spelling, which does not seem
like a good idea.

This is an example class layout that I have problem with:

class A {};

class B {
 A a;

class C {
  const A a;
  B* b;

It's hard to map C->A.

`B` is possitle to obtain through checking `CXType::kind` against
`CXType_Pointer` and `clang_getPointeeType`, so it's not a problem
that `B` and `B*` are different as there is a programatic way to get

Is there a way to do it in current version of libclang? Or, would I
need to manually work with AST.

cfe-dev mailing list
[hidden email]