Commit 1a68968c authored by David Schulz's avatar David Schulz Committed by David Schulz

ClangBackEnd: Fix unsaved file printer for default constructed object.

Change-Id: Ifcc8c2b60521e1f48ca2921d568b4e18d9d0a4eb
Reviewed-by: Nikolai Kosjar's avatarNikolai Kosjar <nikolai.kosjar@qt.io>
parent 82a5320a
......@@ -118,11 +118,16 @@ UnsavedFile::~UnsavedFile()
cxUnsavedFile.Length = 0;
}
static const char *printCString(const char *str)
{
return str ? str : "nullptr";
}
void PrintTo(const UnsavedFile &unsavedFile, std::ostream *os)
{
*os << "UnsavedFile("
<< unsavedFile.cxUnsavedFile.Filename << ", "
<< unsavedFile.cxUnsavedFile.Contents << ", "
<< printCString(unsavedFile.cxUnsavedFile.Filename) << ", "
<< printCString(unsavedFile.cxUnsavedFile.Contents) << ", "
<< unsavedFile.cxUnsavedFile.Length << ")";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment