Index: clang/lib/Format/Format.cpp =================================================================== --- clang/lib/Format/Format.cpp +++ clang/lib/Format/Format.cpp @@ -1062,8 +1062,6 @@ FormatStyle getNoStyle() { FormatStyle NoStyle = getLLVMStyle(); NoStyle.DisableFormat = true; - NoStyle.SortIncludes = false; - NoStyle.SortUsingDeclarations = false; return NoStyle; } @@ -2130,7 +2128,7 @@ ArrayRef Ranges, StringRef FileName, unsigned *Cursor) { tooling::Replacements Replaces; - if (!Style.SortIncludes) + if (!Style.SortIncludes || Style.DisableFormat) return Replaces; if (isLikelyXml(Code)) return Replaces; Index: clang/test/Format/disable-format.cpp =================================================================== --- clang/test/Format/disable-format.cpp +++ clang/test/Format/disable-format.cpp @@ -1,5 +1,9 @@ // RUN: grep -Ev "// *[A-Z-]+:" %s | clang-format -style=none \ // RUN: | FileCheck -strict-whitespace %s -// CHECK: int i; +// CHECK: #include +// CHECK-NEXT: #include +// CHECK-NEXT: int i; +#include +#include int i;