[cfe-dev] Iterate over struct's fields

Miklos Vajna via cfe-dev cfe-dev at lists.llvm.org
Thu Feb 7 00:20:32 PST 2019


Hi,

On Wed, Feb 06, 2019 at 09:36:16AM +0000, "Hayrapetyan, Anahit" <anahit.hayrapetyan at tum.de> wrote:
> When this code is ran on the example I posted, first I get
> TypedefType, then its' underlying type is ElaboratedType which
> getNamedType is the RecordType. So this function is called with
> TypedefType, then ElaboratedType then RecordType. However when I try
> to call field_begin function on RecordDecl obtained from RecordType it
> crashes in clang sources.

Did you investigate the backtrace?

Is it possible you try to look up members of a struct which is
forward-declared only?

Regards,

Miklos
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190207/2f80e388/attachment.sig>


More information about the cfe-dev mailing list