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.
llvm-svn: 114203
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 2de32b0..19f99ae 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/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) {