how to check if a FieldDecl is static or not?

Hi, I checked all the API in FieldDecl and didn’t find how to check if it is a static member, and I tried this also:

auto FieldType = TheField->getType();

and I cannot find any static checking in QualType either.

So how can I check if the field is static or not?

Hi Yafei,

Static members aren't FieldDecls, they are VarDecls.

Take this example

Hi Nathan, thanks a lot, I think your answer teaches me a way of how to figure problems out by myself, I rarely print a class to AST for investigation before.