[clang-tools-extra] 15f1fe1 - clang-format fixes in ClangTidyDiagnosticConsumer.cpp and DiagnosticsTets.cpp
Nathan Ridge via cfe-commits
cfe-commits at lists.llvm.org
Sun Mar 29 12:19:59 PDT 2020
Author: Nathan Ridge
Date: 2020-03-29T15:19:09-04:00
New Revision: 15f1fe1506f5e860409fddd8e62ed5508855ff79
URL: https://github.com/llvm/llvm-project/commit/15f1fe1506f5e860409fddd8e62ed5508855ff79
DIFF: https://github.com/llvm/llvm-project/commit/15f1fe1506f5e860409fddd8e62ed5508855ff79.diff
LOG: clang-format fixes in ClangTidyDiagnosticConsumer.cpp and DiagnosticsTets.cpp
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77023
Added:
Modified:
clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
index 414da2857cff..10d5bdb3b3af 100644
--- a/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
+++ b/clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp
@@ -124,7 +124,6 @@ ClangTidyError::ClangTidyError(StringRef CheckName,
: tooling::Diagnostic(CheckName, DiagLevel, BuildDirectory),
IsWarningAsError(IsWarningAsError) {}
-
class ClangTidyContext::CachedGlobList {
public:
CachedGlobList(StringRef Globs) : Globs(Globs) {}
@@ -710,9 +709,9 @@ struct LessClangTidyError {
const tooling::DiagnosticMessage &M1 = LHS.Message;
const tooling::DiagnosticMessage &M2 = RHS.Message;
- return
- std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName, M1.Message) <
- std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);
+ return std::tie(M1.FilePath, M1.FileOffset, LHS.DiagnosticName,
+ M1.Message) <
+ std::tie(M2.FilePath, M2.FileOffset, RHS.DiagnosticName, M2.Message);
}
};
struct EqualClangTidyError {
diff --git a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
index eb4fdc98fb0b..d72f722921a8 100644
--- a/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
+++ b/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp
@@ -61,9 +61,7 @@ MATCHER_P3(Fix, Range, Replacement, Message,
arg.Edits[0].range == Range && arg.Edits[0].newText == Replacement;
}
-MATCHER_P(FixMessage, Message, "") {
- return arg.Message == Message;
-}
+MATCHER_P(FixMessage, Message, "") { return arg.Message == Message; }
MATCHER_P(EqualToLSPDiag, LSPDiag,
"LSP diagnostic " + llvm::to_string(LSPDiag)) {
@@ -258,13 +256,13 @@ TEST(DiagnosticsTest, ClangTidy) {
Diag(Test.range("macroarg"),
"multiple unsequenced modifications to 'y'"),
AllOf(
- Diag(Test.range("main"),
- "use a trailing return type for this function"),
- DiagSource(Diag::ClangTidy),
- DiagName("modernize-use-trailing-return-type"),
- // Verify that we don't have "[check-name]" suffix in the message.
- WithFix(FixMessage("use a trailing return type for this function")))
- ));
+ Diag(Test.range("main"),
+ "use a trailing return type for this function"),
+ DiagSource(Diag::ClangTidy),
+ DiagName("modernize-use-trailing-return-type"),
+ // Verify that we don't have "[check-name]" suffix in the message.
+ WithFix(FixMessage(
+ "use a trailing return type for this function")))));
}
TEST(DiagnosticTest, ClangTidySuppressionComment) {
@@ -836,8 +834,9 @@ TEST(IncludeFixerTest, NoCrashOnTemplateInstantiations) {
auto Index = buildIndexWithSymbol({});
TU.ExternalIndex = Index.get();
- EXPECT_THAT(TU.build().getDiagnostics(),
- ElementsAre(Diag(Test.range(), "use of undeclared identifier 'a'")));
+ EXPECT_THAT(
+ TU.build().getDiagnostics(),
+ ElementsAre(Diag(Test.range(), "use of undeclared identifier 'a'")));
}
TEST(DiagsInHeaders, DiagInsideHeader) {
More information about the cfe-commits
mailing list