aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/CIndexCXX.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-10-20 21:14:49 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-10-20 21:14:49 +0000
commit36981b17ed939300f6f8fc2355a255f711fcef71 (patch)
treeee2483e98b09cac943dc93a6969d83ca737ff139 /tools/libclang/CIndexCXX.cpp
parent180abc3db9ae3b4fc63cd65b15697e6ffcc8a657 (diff)
downloadsrc-36981b17ed939300f6f8fc2355a255f711fcef71.tar.gz
src-36981b17ed939300f6f8fc2355a255f711fcef71.zip
Vendor import of clang release_30 branch r142614:vendor/clang/clang-r142614
Notes
Notes: svn path=/vendor/clang/dist/; revision=226586 svn path=/vendor/clang/clang-r142614/; revision=226587; tag=vendor/clang/clang-r142614
Diffstat (limited to 'tools/libclang/CIndexCXX.cpp')
-rw-r--r--tools/libclang/CIndexCXX.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/libclang/CIndexCXX.cpp b/tools/libclang/CIndexCXX.cpp
index 0f49f65c2b80..fb0ccb146f7d 100644
--- a/tools/libclang/CIndexCXX.cpp
+++ b/tools/libclang/CIndexCXX.cpp
@@ -31,11 +31,16 @@ unsigned clang_isVirtualBase(CXCursor C) {
}
enum CX_CXXAccessSpecifier clang_getCXXAccessSpecifier(CXCursor C) {
- if (C.kind != CXCursor_CXXBaseSpecifier)
+ AccessSpecifier spec = AS_none;
+
+ if (C.kind == CXCursor_CXXAccessSpecifier)
+ spec = getCursorDecl(C)->getAccess();
+ else if (C.kind == CXCursor_CXXBaseSpecifier)
+ spec = getCursorCXXBaseSpecifier(C)->getAccessSpecifier();
+ else
return CX_CXXInvalidAccessSpecifier;
- CXXBaseSpecifier *B = getCursorCXXBaseSpecifier(C);
- switch (B->getAccessSpecifier()) {
+ switch (spec) {
case AS_public: return CX_CXXPublic;
case AS_protected: return CX_CXXProtected;
case AS_private: return CX_CXXPrivate;