aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/AST/ASTContext.cpp2
-rw-r--r--tools/libclang/CIndex.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index 820288eae3..f208f06111 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -155,6 +155,8 @@ const RawComment *ASTContext::getRawCommentForDecl(const Decl *D) const {
return Pos->second;
const RawComment *RC = getRawCommentForDeclNoCache(D);
+ // If we found a comment, it should be a documentation comment.
+ assert(!RC || RC->isDocumentation());
DeclComments[D] = RC;
return RC;
}
diff --git a/tools/libclang/CIndex.cpp b/tools/libclang/CIndex.cpp
index 250e9e7b2d..c7d1523349 100644
--- a/tools/libclang/CIndex.cpp
+++ b/tools/libclang/CIndex.cpp
@@ -5715,7 +5715,7 @@ CXString clang_Cursor_getBriefCommentText(CXCursor C) {
const ASTContext &Context = getCursorContext(C);
const RawComment *RC = Context.getRawCommentForDecl(D);
- if (RC && RC->isDocumentation()) {
+ if (RC) {
StringRef BriefText = RC->getBriefText(Context);
// Don't duplicate the string because RawComment ensures that this memory