diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2017-11-15 12:20:41 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2017-11-15 12:20:41 +0000 |
commit | 818167bc99a0f5538a2676bf876e5c598d1b449b (patch) | |
tree | 49fc0cfb5e63fbec383c1e8aaa676afbb057c2e2 /tools | |
parent | 0f512ed5d31bb3b8aa0b07d50e37735c02600b51 (diff) |
[libclang] Fix cursors for in-class initializer of field declarations
Fixes PR33745.
Patch by Nikolai Kosjar!
Differential Revision: https://reviews.llvm.org/D40027
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libclang/CIndex.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp index 2a1b63d83e..74a17d21e0 100644 --- a/tools/libclang/CIndex.cpp +++ b/tools/libclang/CIndex.cpp @@ -877,6 +877,9 @@ bool CursorVisitor::VisitFieldDecl(FieldDecl *D) { if (Expr *BitWidth = D->getBitWidth()) return Visit(MakeCXCursor(BitWidth, StmtParent, TU, RegionOfInterest)); + if (Expr *Init = D->getInClassInitializer()) + return Visit(MakeCXCursor(Init, StmtParent, TU, RegionOfInterest)); + return false; } |