FieldDecl isReferenced() within a certain class?

Hi everyone,

Maybe my question has a simple answer, but after a time searching for the solution, I haven’t found how could I know if a fieldDecl has been referenced in a certain class.

An example:

class A{
int a;
int method(){ return a;}


class B: public A{


In the above example, if I use the method “isReferenced()” regarding the member variable “a”, I think I will get “true” because it was returned in “method”. However, if I want to know if that member was referenced within the class “B” (or a subset of classes), how could I do that? (not only in inline methods, but also in redeclarations)

Thanks in advance,