ClangFormat: Adapt to clang 11 API changes

Change-Id: Id5d977e56017a80138f2c033e145b67446eff3ab
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-03 11:11:16 +02:00
parent f392d13419
commit eaea03ba42
2 changed files with 5 additions and 1 deletions

View File

@@ -343,7 +343,7 @@ Utils::Text::Replacements utf16Replacements(const QTextDocument *doc,
.size(); .size();
convertedReplacements.emplace_back(utf16Offset, convertedReplacements.emplace_back(utf16Offset,
utf16Length, utf16Length,
QString::fromStdString(replacement.getReplacementText())); QString::fromStdString(replacement.getReplacementText().str()));
} }
return convertedReplacements; return convertedReplacements;

View File

@@ -54,7 +54,11 @@ static clang::format::FormatStyle qtcStyle()
style.AlignConsecutiveAssignments = false; style.AlignConsecutiveAssignments = false;
style.AlignConsecutiveDeclarations = false; style.AlignConsecutiveDeclarations = false;
style.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign; style.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign;
#if LLVM_VERSION_MAJOR >= 11
style.AlignOperands = FormatStyle::OAS_Align;
#else
style.AlignOperands = true; style.AlignOperands = true;
#endif
style.AlignTrailingComments = true; style.AlignTrailingComments = true;
style.AllowAllParametersOfDeclarationOnNextLine = true; style.AllowAllParametersOfDeclarationOnNextLine = true;
#if LLVM_VERSION_MAJOR >= 10 #if LLVM_VERSION_MAJOR >= 10