diff --git a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp --- a/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp +++ b/clang-tools-extra/clang-tidy/llvm/IncludeOrderCheck.cpp @@ -67,7 +67,8 @@ return 2; // System headers are sorted to the end. - if (IsAngled || Filename.startswith("gtest/")) + if (IsAngled || Filename.startswith("gtest/") || + Filename.startswith("gmock/")) return 3; // Other headers are inserted between the main module header and LLVM headers. diff --git a/clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp b/clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp --- a/clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp +++ b/clang-tools-extra/test/clang-tidy/checkers/llvm-include-order.cpp @@ -3,6 +3,7 @@ // CHECK-MESSAGES: [[@LINE+2]]:1: warning: #includes are not sorted properly #include "j.h" #include "gtest/foo.h" +#include "gmock/foo.h" #include "i.h" #include #include "llvm/a.h" @@ -16,6 +17,7 @@ // CHECK-FIXES-NEXT: #include "clang/b.h" // CHECK-FIXES-NEXT: #include "llvm-c/d.h" // -c // CHECK-FIXES-NEXT: #include "llvm/a.h" +// CHECK-FIXES-NEXT: #include "gmock/foo.h" // CHECK-FIXES-NEXT: #include "gtest/foo.h" // CHECK-FIXES-NEXT: #include