I am new to clang development, and I would like to have some warnings if an assignment of function pointer doesn’t match the LHS attributes: void attribute((Attrs)) (*func)() = foo should warn if foo doesn’t have Attrs.
I have started adding some code around Sema::CheckSingleAssignmentConstraints. I can get the attrs from the LHS, LHSType.getTypePtr() / ->getAs() if necessary / ->getDecl() and use attribute getters. However, I have more trouble with the RHS for some reason, RHS.get()->getType() is a FunctionProtoType. How can I get the associated attributes from there?
thanks a lot