summaryrefslogtreecommitdiff
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-test2-36981b17ed939300f6f8fc2355a255f711fcef71.tar.gz
src-test2-36981b17ed939300f6f8fc2355a255f711fcef71.zip
Notes
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;