diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index fb8e6938096..6378b2af530 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -42,7 +42,11 @@ void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style, ReplacementsToKeep replacementsToKeep) { style.MaxEmptyLinesToKeep = 100; +#if LLVM_VERSION_MAJOR >= 13 + style.SortIncludes = clang::format::FormatStyle::SI_Never; +#else style.SortIncludes = false; +#endif style.SortUsingDeclarations = false; // This is a separate pass, don't do it unless it's the full formatting. diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index a249327d0ed..770e75908c8 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -145,7 +145,11 @@ static clang::format::FormatStyle qtcStyle() style.PenaltyReturnTypeOnItsOwnLine = 300; style.PointerAlignment = FormatStyle::PAS_Right; style.ReflowComments = false; +#ifdef LLVM_VERSION_MAJOR >= 13 + style.SortIncludes = FormatStyle::SI_CaseSensitive; +#else style.SortIncludes = true; +#endif style.SortUsingDeclarations = true; style.SpaceAfterCStyleCast = true; style.SpaceAfterTemplateKeyword = false;