[cfe-dev] querying access spec for declaration in clang-c

Stefan Seefeld stefan at seefeld.name
Tue Dec 11 06:40:38 PST 2012


Hello,

The clang-c API at present doesn't (appear to) support querying the
access spec associated with a given declaration. If I parse a
struct/class, I want to know whether a given member (field) is
public/protected/private, but that information isn't available right
now. I'm considering submitting a patch but I would like to ask for some
help:

1) What is the appropriate API in the AST API underneath to query that ?
2) Would it be OK to augment the clang-c function
clang_getCXXAccessSpecifier to accept arbitrary declarations and return
their associated access specs ? Right now it appears that function is
restricted to be used with base specs or access specs themselves.

Thanks,
		Stefan



-- 

      ...ich hab' noch einen Koffer in Berlin...



More information about the cfe-dev mailing list