Hi Dodji,

Dodji Seketeli <do...@seketeli.org> writes:

> Boris Kolpackov <bo...@codesynthesis.com> a =C3=A9crit:
>
> > struct s {};
> >
> > typedef s s_t;
> > typedef s_t my_s_t;
> >
> > my_s_t x;
> >
>
> In G++, let's say that the tree node representing my_s_t is t.  Then,
> DECL_ORIGINAL_TYPE (TYPE_NAME (t)) points to the tree node of s_t.  You
> can walk the relationship "t is a typedef of foo" like that.

Yes, that's exactly what I was looking for. Thanks for the pointer!

While it works well for the above case, a template argument in the
path seems to break things. For example:

template <typename T>
struct wrap
{
  typedef T w_s;
};

typedef wrap<my_s_t>::w_s w_s_t;

Now if I traverse from w_s_t using DECL_ORIGINAL_TYPE I get:

w_s_t->w_s->s

Instead of:

w_s_t->w_s->my_s_t->s_t->s

Do you know if there is a way to get this information?

Thanks,
        Boris

Reply via email to