ClangBackEnd: Convert Windows line endings in Cursor::rawComment()

The comment really is "raw" in that clang does not convert \r\n, so we
have to do that ourselves.
This fixes another unit test case on Windows.

Change-Id: If70678485ed31c241a04fc44b3502e1ff3252508
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-09-17 17:08:43 +02:00
parent 3ca54e7da7
commit 8427c283cb
2 changed files with 5 additions and 3 deletions

View File

@@ -246,9 +246,11 @@ ClangString Cursor::briefComment() const
return ClangString(clang_Cursor_getBriefCommentText(m_cxCursor));
}
ClangString Cursor::rawComment() const
Utf8String Cursor::rawComment() const
{
return ClangString(clang_Cursor_getRawCommentText(m_cxCursor));
Utf8String comment = ClangString(clang_Cursor_getRawCommentText(m_cxCursor));
comment.replace(Utf8String("\r\n"), Utf8String("\n"));
return comment;
}
int Cursor::argumentCount() const

View File

@@ -79,7 +79,7 @@ public:
ClangString mangling() const;
ClangString spelling() const;
ClangString briefComment() const;
ClangString rawComment() const;
Utf8String rawComment() const;
int argumentCount() const;
Type type() const;