When traversing an InitListExpr, there may not be a syntactic form;
check for NULL and visit the InitListExpr we have if there is no
syntactic form.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114203 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 2de32b0..19f99ae 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1663,7 +1663,10 @@
bool CursorVisitor::VisitInitListExpr(InitListExpr *E) {
// We care about the syntactic form of the initializer list, only.
- return VisitExpr(E->getSyntacticForm());
+ if (InitListExpr *Syntactic = E->getSyntacticForm())
+ return VisitExpr(Syntactic);
+
+ return VisitExpr(E);
}
bool CursorVisitor::VisitDesignatedInitExpr(DesignatedInitExpr *E) {