diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp index d61cbf2f1a8..fc08158d2d1 100644 --- a/src/plugins/clangformat/clangformatbaseindenter.cpp +++ b/src/plugins/clangformat/clangformatbaseindenter.cpp @@ -38,7 +38,11 @@ void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style, #else style.SortIncludes = false; #endif +#if LLVM_VERSION_MAJOR >= 16 + style.SortUsingDeclarations = clang::format::FormatStyle::SUD_Never; +#else style.SortUsingDeclarations = false; +#endif // This is a separate pass, don't do it unless it's the full formatting. style.FixNamespaceComments = false; diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index c7eb900fed5..d1d6bee684b 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -151,7 +151,11 @@ clang::format::FormatStyle qtcStyle() #else style.SortIncludes = true; #endif +#if LLVM_VERSION_MAJOR >= 16 + style.SortUsingDeclarations = FormatStyle::SUD_Lexicographic; +#else style.SortUsingDeclarations = true; +#endif style.SpaceAfterCStyleCast = true; style.SpaceAfterTemplateKeyword = false; style.SpaceBeforeAssignmentOperators = true;