[cfe-dev] How to iterate the members of AccessSpecDecl object.

Talespin Kit talespin_kit at yahoo.com
Sun Feb 20 23:40:25 PST 2011


The documentation of AccessSpecDecl says

AccessSpecDecl - An access specifier followed by a colon ':'.

An objects of this class represents sugar for the syntactic occurence
of an access specifier followed by a colon in the list of member
specifiers of a C++ class definition.

Note that they do not repesent other uses of access specifiers,
such as those occuring in a list of base specifiers.
Also note that this class has nothing to do with so-called
"access declarations" (C++98 11.3 [class.access.dcl]).

Does the documentation has to be updated. ?
--- On Fri, 2/18/11, Douglas Gregor <dgregor at apple.com> wrote:

From: Douglas Gregor <dgregor at apple.com>
Subject: Re: [cfe-dev] How to iterate the members of AccessSpecDecl object.
To: "Talespin Kit" <talespin_kit at yahoo.com>
Cc: cfe-dev at cs.uiuc.edu
Date: Friday, February 18, 2011, 3:48 PM


On Feb 18, 2011, at 2:57 AM, Talespin Kit wrote:
How to get the source location of the AccessSpecifer using a CXXMethodDecl, 

or

using a AccessSpecDecl object how to traverse the members under it.

Just walk through the members of the class declaration (i.e., a CXXRecordDecl) with decls_begin()/decls_end(), which come in source order. When you see an AccessSpecDecl, make that the "current" access specification decl, which specifies the access of all of the declarations that follow (until the next AccessSpecDecl, of course).
	- Doug


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110220/7730d91c/attachment.html>


More information about the cfe-dev mailing list