Clang: Fix SourceLocation column recalculation

Fix column conversion according to the fact that
columns are 1-based.

Change-Id: I75e9b966d96b9bb7648822b564e57f8838ebb3f8
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-10-16 10:39:20 +02:00
parent fac917b477
commit 3e93f66c5d

View File

@@ -102,7 +102,7 @@ SourceLocation::SourceLocation(CXTranslationUnit cxTranslationUnit,
// (2) column in Clang is the utf8 byte offset from the beginning of the line.
// Here we convert column from (2) to (1).
column_ = static_cast<uint>(QString::fromUtf8(&contents[lineStart],
static_cast<int>(column_)).size());
static_cast<int>(column_) - 1).size()) + 1;
}
}