[cfe-dev] Type Information for C++ classes

Manuel Klimek klimek at google.com
Wed Oct 10 08:29:44 PDT 2012


On Wed, Oct 10, 2012 at 2:05 AM, madil90 <madil90 at gmail.com> wrote:
> Hi,
>    I am trying to find the type of a VarDecl. I am currently using the
> VarDecl->getOriginalType(). This function does not work for C++ classes.
> Consider the code below:

Does getType() not work for you for some reason?

Cheers,
/Manuel

>
> class Foo
> {
>     int a;
> };
>
> int f( Foo foo);
>
> When I try to find the type for "foo" in the function decleration, it
> returns "int", while the actual type is Foo. If Foo is a structure, this
> works perfectly fine but not for C++ classes. Can some one please explain
> where the type information for C++ classes is stored?
>
>
>
> --
> View this message in context: http://clang-developers.42468.n3.nabble.com/Type-Information-for-C-classes-tp4027266.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list