summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2016-09-13 01:37:01 +0000
committerRichard Trieu <rtrieu@google.com>2016-09-13 01:37:01 +0000
commite3a335ebd724f0ee206658bd19c571bdd5204c15 (patch)
treebcd9693be91bb6b71a74faa0fe78bee40d10585e /tools
parent3fdacc178fd2b752353fc6a0695d0be635bbbbc0 (diff)
downloadclang-e3a335ebd724f0ee206658bd19c571bdd5204c15.tar.gz
Handle empty message in static_asserts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/libclang/CIndex.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 0cc03c708e..8cbedd0ad8 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -1243,8 +1243,9 @@ bool CursorVisitor::VisitUnresolvedUsingTypenameDecl(
bool CursorVisitor::VisitStaticAssertDecl(StaticAssertDecl *D) {
if (Visit(MakeCXCursor(D->getAssertExpr(), StmtParent, TU, RegionOfInterest)))
return true;
- if (Visit(MakeCXCursor(D->getMessage(), StmtParent, TU, RegionOfInterest)))
- return true;
+ if (StringLiteral *Message = D->getMessage())
+ if (Visit(MakeCXCursor(Message, StmtParent, TU, RegionOfInterest)))
+ return true;
return false;
}