[clang-tools-extra] [clang-tidy][NFC] run clang-format over 'cert', 'cppcore', 'fuchsia',… (PR #143316)
Baranov Victor via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 8 09:42:55 PDT 2025
https://github.com/vbvictor created https://github.com/llvm/llvm-project/pull/143316
… 'google' checks
>From 50485a9c1c14325f7bf019827b461bcefe053d3c Mon Sep 17 00:00:00 2001
From: Baranov Victor <bar.victor.2002 at gmail.com>
Date: Sun, 8 Jun 2025 19:39:49 +0300
Subject: [PATCH] [clang-tidy][NFC] run clang-format over 'cert', 'cppcore',
'fuchsia', 'google' checks
---
.../clang-tidy/cert/CERTTidyModule.cpp | 6 +--
.../ProTypeMemberInitCheck.cpp | 54 ++++++++++---------
.../cppcoreguidelines/SlicingCheck.h | 6 +--
.../SpecialMemberFunctionsCheck.cpp | 3 +-
.../SpecialMemberFunctionsCheck.h | 5 +-
.../clang-tidy/darwin/AvoidSpinlockCheck.h | 4 +-
.../clang-tidy/darwin/DarwinTidyModule.cpp | 3 +-
.../fuchsia/MultipleInheritanceCheck.cpp | 27 ++++++----
.../StaticallyConstructedObjectsCheck.h | 2 +-
.../clang-tidy/fuchsia/TrailingReturnCheck.h | 4 +-
.../fuchsia/VirtualInheritanceCheck.cpp | 9 ++--
.../fuchsia/VirtualInheritanceCheck.h | 4 +-
.../google/AvoidCStyleCastsCheck.cpp | 4 +-
.../google/AvoidThrowingObjCExceptionCheck.h | 4 +-
.../google/ExplicitConstructorCheck.cpp | 2 +-
.../google/GlobalNamesInHeadersCheck.cpp | 2 +-
.../google/GlobalVariableDeclarationCheck.cpp | 2 +-
.../google/GlobalVariableDeclarationCheck.h | 4 +-
.../clang-tidy/google/GoogleTidyModule.cpp | 4 +-
.../clang-tidy/google/IntegerTypesCheck.cpp | 4 +-
.../google/UnnamedNamespaceInHeaderCheck.cpp | 4 +-
.../google/UsingNamespaceDirectiveCheck.cpp | 2 +-
22 files changed, 83 insertions(+), 76 deletions(-)
diff --git a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
index cc092a9627c5f..6614b10d4ce40 100644
--- a/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp
@@ -250,8 +250,7 @@ class CERTModule : public ClangTidyModule {
"cert-dcl51-cpp");
CheckFactories.registerCheck<misc::NewDeleteOverloadsCheck>(
"cert-dcl54-cpp");
- CheckFactories.registerCheck<DontModifyStdNamespaceCheck>(
- "cert-dcl58-cpp");
+ CheckFactories.registerCheck<DontModifyStdNamespaceCheck>("cert-dcl58-cpp");
CheckFactories.registerCheck<google::build::UnnamedNamespaceInHeaderCheck>(
"cert-dcl59-cpp");
// ERR
@@ -278,8 +277,7 @@ class CERTModule : public ClangTidyModule {
"cert-oop54-cpp");
CheckFactories.registerCheck<NonTrivialTypesLibcMemoryCallsCheck>(
"cert-oop57-cpp");
- CheckFactories.registerCheck<MutatingCopyCheck>(
- "cert-oop58-cpp");
+ CheckFactories.registerCheck<MutatingCopyCheck>("cert-oop58-cpp");
// C checkers
// ARR
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
index d665c47d12bb4..aaaaf6b66b51a 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp
@@ -433,21 +433,22 @@ void ProTypeMemberInitCheck::checkMissingMemberInitializer(
// Gather all fields (direct and indirect) that need to be initialized.
SmallPtrSet<const FieldDecl *, 16> FieldsToInit;
bool AnyMemberHasInitPerUnion = false;
- forEachFieldWithFilter(ClassDecl, ClassDecl.fields(),
- AnyMemberHasInitPerUnion, [&](const FieldDecl *F) {
- if (IgnoreArrays && F->getType()->isArrayType())
- return;
- if (F->hasInClassInitializer() && F->getParent()->isUnion()) {
- AnyMemberHasInitPerUnion = true;
- removeFieldInitialized(F, FieldsToInit);
- }
- if (!F->hasInClassInitializer() &&
- utils::type_traits::isTriviallyDefaultConstructible(F->getType(),
- Context) &&
- !isEmpty(Context, F->getType()) && !F->isUnnamedBitField() &&
- !AnyMemberHasInitPerUnion)
- FieldsToInit.insert(F);
- });
+ forEachFieldWithFilter(
+ ClassDecl, ClassDecl.fields(), AnyMemberHasInitPerUnion,
+ [&](const FieldDecl *F) {
+ if (IgnoreArrays && F->getType()->isArrayType())
+ return;
+ if (F->hasInClassInitializer() && F->getParent()->isUnion()) {
+ AnyMemberHasInitPerUnion = true;
+ removeFieldInitialized(F, FieldsToInit);
+ }
+ if (!F->hasInClassInitializer() &&
+ utils::type_traits::isTriviallyDefaultConstructible(F->getType(),
+ Context) &&
+ !isEmpty(Context, F->getType()) && !F->isUnnamedBitField() &&
+ !AnyMemberHasInitPerUnion)
+ FieldsToInit.insert(F);
+ });
if (FieldsToInit.empty())
return;
@@ -500,17 +501,18 @@ void ProTypeMemberInitCheck::checkMissingMemberInitializer(
AnyMemberHasInitPerUnion = false;
forEachFieldWithFilter(ClassDecl, ClassDecl.fields(),
AnyMemberHasInitPerUnion, [&](const FieldDecl *F) {
- if (!FieldsToInit.count(F))
- return;
- // Don't suggest fixes for enums because we don't know a good default.
- // Don't suggest fixes for bitfields because in-class initialization is not
- // possible until C++20.
- if (F->getType()->isEnumeralType() ||
- (!getLangOpts().CPlusPlus20 && F->isBitField()))
- return;
- FieldsToFix.insert(F);
- AnyMemberHasInitPerUnion = true;
- });
+ if (!FieldsToInit.count(F))
+ return;
+ // Don't suggest fixes for enums because we don't
+ // know a good default. Don't suggest fixes for
+ // bitfields because in-class initialization is not
+ // possible until C++20.
+ if (F->getType()->isEnumeralType() ||
+ (!getLangOpts().CPlusPlus20 && F->isBitField()))
+ return;
+ FieldsToFix.insert(F);
+ AnyMemberHasInitPerUnion = true;
+ });
if (FieldsToFix.empty())
return;
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.h
index 00f6e93fec200..02bfaf1205f40 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/SlicingCheck.h
@@ -14,11 +14,7 @@
namespace clang::tidy::cppcoreguidelines {
/// Flags slicing (incomplete copying of an object's state) of member variables
-/// or vtable. See:
-/// - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es63-dont-slice
-/// for the former, and
-/// - https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c145-access-polymorphic-objects-through-pointers-and-references
-/// for the latter
+/// or vtable.
///
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/slicing.html
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
index b1da3b9861c69..0de143dbb1b89 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.cpp
@@ -116,7 +116,8 @@ void SpecialMemberFunctionsCheck::check(
if (!MatchedDecl)
return;
- ClassDefId ID(MatchedDecl->getLocation(), std::string(MatchedDecl->getName()));
+ ClassDefId ID(MatchedDecl->getLocation(),
+ std::string(MatchedDecl->getName()));
auto StoreMember = [this, &ID](SpecialMemberFunctionData Data) {
llvm::SmallVectorImpl<SpecialMemberFunctionData> &Members =
diff --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
index 9ebc03ed2fa13..dee01cb5a9fdd 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/SpecialMemberFunctionsCheck.h
@@ -84,13 +84,12 @@ struct DenseMapInfo<
clang::tidy::cppcoreguidelines::SpecialMemberFunctionsCheck::ClassDefId;
static inline ClassDefId getEmptyKey() {
- return {DenseMapInfo<clang::SourceLocation>::getEmptyKey(),
- "EMPTY"};
+ return {DenseMapInfo<clang::SourceLocation>::getEmptyKey(), "EMPTY"};
}
static inline ClassDefId getTombstoneKey() {
return {DenseMapInfo<clang::SourceLocation>::getTombstoneKey(),
- "TOMBSTONE"};
+ "TOMBSTONE"};
}
static unsigned getHashValue(ClassDefId Val) {
diff --git a/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.h b/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.h
index 727878b258b2c..5b5285710c3b0 100644
--- a/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.h
+++ b/clang-tools-extra/clang-tidy/darwin/AvoidSpinlockCheck.h
@@ -19,7 +19,7 @@ namespace clang::tidy::darwin {
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/darwin/avoid-spinlock.html
class AvoidSpinlockCheck : public ClangTidyCheck {
- public:
+public:
AvoidSpinlockCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
@@ -28,4 +28,4 @@ class AvoidSpinlockCheck : public ClangTidyCheck {
} // namespace clang::tidy::darwin
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_AVOIDSPINLOCKCHECK_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_DARWIN_AVOIDSPINLOCKCHECK_H
diff --git a/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp b/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp
index 3475deada499d..616a2a2a85c56 100644
--- a/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/darwin/DarwinTidyModule.cpp
@@ -18,8 +18,7 @@ namespace darwin {
class DarwinModule : public ClangTidyModule {
public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
- CheckFactories.registerCheck<AvoidSpinlockCheck>(
- "darwin-avoid-spinlock");
+ CheckFactories.registerCheck<AvoidSpinlockCheck>("darwin-avoid-spinlock");
CheckFactories.registerCheck<DispatchOnceNonstaticCheck>(
"darwin-dispatch-once-nonstatic");
}
diff --git a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
index b5ce23ae8feda..80ff97a762134 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/MultipleInheritanceCheck.cpp
@@ -49,7 +49,8 @@ bool MultipleInheritanceCheck::getInterfaceStatus(const CXXRecordDecl *Node,
bool MultipleInheritanceCheck::isCurrentClassInterface(
const CXXRecordDecl *Node) const {
// Interfaces should have no fields.
- if (!Node->field_empty()) return false;
+ if (!Node->field_empty())
+ return false;
// Interfaces should have exclusively pure methods.
return llvm::none_of(Node->methods(), [](const CXXMethodDecl *M) {
@@ -68,11 +69,14 @@ bool MultipleInheritanceCheck::isInterface(const CXXRecordDecl *Node) {
// To be an interface, all base classes must be interfaces as well.
for (const auto &I : Node->bases()) {
- if (I.isVirtual()) continue;
+ if (I.isVirtual())
+ continue;
const auto *Ty = I.getType()->getAs<RecordType>();
- if (!Ty) continue;
+ if (!Ty)
+ continue;
const RecordDecl *D = Ty->getDecl()->getDefinition();
- if (!D) continue;
+ if (!D)
+ continue;
const auto *Base = cast<CXXRecordDecl>(D);
if (!isInterface(Base)) {
addNodeToInterfaceMap(Node, false);
@@ -97,20 +101,25 @@ void MultipleInheritanceCheck::check(const MatchFinder::MatchResult &Result) {
// concrete classes
unsigned NumConcrete = 0;
for (const auto &I : D->bases()) {
- if (I.isVirtual()) continue;
+ if (I.isVirtual())
+ continue;
const auto *Ty = I.getType()->getAs<RecordType>();
- if (!Ty) continue;
+ if (!Ty)
+ continue;
const auto *Base = cast<CXXRecordDecl>(Ty->getDecl()->getDefinition());
- if (!isInterface(Base)) NumConcrete++;
+ if (!isInterface(Base))
+ NumConcrete++;
}
// Check virtual bases to see if there is more than one concrete
// non-virtual base.
for (const auto &V : D->vbases()) {
const auto *Ty = V.getType()->getAs<RecordType>();
- if (!Ty) continue;
+ if (!Ty)
+ continue;
const auto *Base = cast<CXXRecordDecl>(Ty->getDecl()->getDefinition());
- if (!isInterface(Base)) NumConcrete++;
+ if (!isInterface(Base))
+ NumConcrete++;
}
if (NumConcrete > 1) {
diff --git a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
index fc18273ad73b8..6c65c8cfeb22f 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
+++ b/clang-tools-extra/clang-tidy/fuchsia/StaticallyConstructedObjectsCheck.h
@@ -14,7 +14,7 @@
namespace clang::tidy::fuchsia {
/// Constructing global, non-trivial objects with static storage is
-/// disallowed, unless the object is statically initialized with a constexpr
+/// disallowed, unless the object is statically initialized with a constexpr
/// constructor or has no explicit constructor.
///
/// For the user-facing documentation see:
diff --git a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h
index 2ba8e27d00bfd..70551844898f1 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h
+++ b/clang-tools-extra/clang-tidy/fuchsia/TrailingReturnCheck.h
@@ -13,8 +13,8 @@
namespace clang::tidy::fuchsia {
-/// Functions that have trailing returns are disallowed, except for those
-/// using decltype specifiers and lambda with otherwise unutterable
+/// Functions that have trailing returns are disallowed, except for those
+/// using decltype specifiers and lambda with otherwise unutterable
/// return types.
///
/// For the user-facing documentation see:
diff --git a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
index 9c367423fdb53..20bd036fb265f 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
+++ b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.cpp
@@ -16,10 +16,13 @@ namespace clang::tidy::fuchsia {
namespace {
AST_MATCHER(CXXRecordDecl, hasDirectVirtualBaseClass) {
- if (!Node.hasDefinition()) return false;
- if (!Node.getNumVBases()) return false;
+ if (!Node.hasDefinition())
+ return false;
+ if (!Node.getNumVBases())
+ return false;
for (const CXXBaseSpecifier &Base : Node.bases())
- if (Base.isVirtual()) return true;
+ if (Base.isVirtual())
+ return true;
return false;
}
} // namespace
diff --git a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.h b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.h
index d109bd52a1a66..426d89d046a63 100644
--- a/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.h
+++ b/clang-tools-extra/clang-tidy/fuchsia/VirtualInheritanceCheck.h
@@ -18,7 +18,7 @@ namespace clang::tidy::fuchsia {
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/fuchsia/virtual-inheritance.html
class VirtualInheritanceCheck : public ClangTidyCheck {
- public:
+public:
VirtualInheritanceCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
@@ -27,4 +27,4 @@ class VirtualInheritanceCheck : public ClangTidyCheck {
} // namespace clang::tidy::fuchsia
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_VIRTUAL_INHERITANCE_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_FUCHSIA_VIRTUAL_INHERITANCE_H
diff --git a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
index 3109bbb3724c7..e076b39b5d978 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/AvoidCStyleCastsCheck.cpp
@@ -120,8 +120,8 @@ void AvoidCStyleCastsCheck::check(const MatchFinder::MatchResult &Result) {
IsFunction(SourceTypeAsWritten) && IsFunction(DestTypeAsWritten);
const bool ConstructorCast = !CastExpr->getTypeAsWritten().hasQualifiers() &&
- DestTypeAsWritten->isRecordType() &&
- !DestTypeAsWritten->isElaboratedTypeSpecifier();
+ DestTypeAsWritten->isRecordType() &&
+ !DestTypeAsWritten->isElaboratedTypeSpecifier();
if (CastExpr->getCastKind() == CK_NoOp && !FnToFnCast) {
// Function pointer/reference casts may be needed to resolve ambiguities in
diff --git a/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h b/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
index f8b191a376204..58b46e0a075a4 100644
--- a/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
+++ b/clang-tools-extra/clang-tidy/google/AvoidThrowingObjCExceptionCheck.h
@@ -20,7 +20,7 @@ namespace clang::tidy::google::objc {
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/google/objc-avoid-throwing-exception.html
class AvoidThrowingObjCExceptionCheck : public ClangTidyCheck {
- public:
+public:
AvoidThrowingObjCExceptionCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
@@ -32,4 +32,4 @@ class AvoidThrowingObjCExceptionCheck : public ClangTidyCheck {
} // namespace clang::tidy::google::objc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_AVOID_THROWING_EXCEPTION_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_AVOID_THROWING_EXCEPTION_H
diff --git a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
index 6f26de9881357..3deea0620514b 100644
--- a/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/ExplicitConstructorCheck.cpp
@@ -85,7 +85,7 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {
"%0 explicit expression evaluates to 'false'";
if (const auto *Conversion =
- Result.Nodes.getNodeAs<CXXConversionDecl>("conversion")) {
+ Result.Nodes.getNodeAs<CXXConversionDecl>("conversion")) {
if (Conversion->isOutOfLine())
return;
SourceLocation Loc = Conversion->getLocation();
diff --git a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
index cba8d71ab6a31..459dee1247525 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/GlobalNamesInHeadersCheck.cpp
@@ -1,4 +1,4 @@
-//===--- GlobalNamesInHeadersCheck.cpp - clang-tidy -----------------*- C++ -*-===//
+//===--- GlobalNamesInHeadersCheck.cpp - clang-tidy --------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
diff --git a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
index 018d49fa5a22b..9082c9368d87d 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.cpp
@@ -52,7 +52,7 @@ FixItHint generateFixItHint(const VarDecl *Decl, bool IsConst) {
CharSourceRange::getTokenRange(SourceRange(Decl->getLocation())),
llvm::StringRef(NewName));
}
-} // namespace
+} // namespace
void GlobalVariableDeclarationCheck::registerMatchers(MatchFinder *Finder) {
// need to add two matchers since we need to bind different ids to distinguish
diff --git a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.h b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.h
index 550224b26d140..19e6c5dbc8e22 100644
--- a/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.h
+++ b/clang-tools-extra/clang-tidy/google/GlobalVariableDeclarationCheck.h
@@ -20,7 +20,7 @@ namespace clang::tidy::google::objc {
/// For the user-facing documentation see:
/// http://clang.llvm.org/extra/clang-tidy/checks/google/objc-global-variable-declaration.html
class GlobalVariableDeclarationCheck : public ClangTidyCheck {
- public:
+public:
GlobalVariableDeclarationCheck(StringRef Name, ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
@@ -32,4 +32,4 @@ class GlobalVariableDeclarationCheck : public ClangTidyCheck {
} // namespace clang::tidy::google::objc
-#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_GLOBAL_VARIABLE_DECLARATION_H
+#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_GOOGLE_OBJC_GLOBAL_VARIABLE_DECLARATION_H
diff --git a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
index 830a37af1accf..5b783c40ddb34 100644
--- a/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/google/GoogleTidyModule.cpp
@@ -35,7 +35,7 @@ namespace clang::tidy {
namespace google {
class GoogleModule : public ClangTidyModule {
- public:
+public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
CheckFactories.registerCheck<build::ExplicitMakePairCheck>(
"google-build-explicit-make-pair");
@@ -96,7 +96,7 @@ class GoogleModule : public ClangTidyModule {
static ClangTidyModuleRegistry::Add<GoogleModule> X("google-module",
"Adds Google lint checks.");
-} // namespace google
+} // namespace google
// This anchor is used to force the linker to link in the generated object file
// and thus register the GoogleModule.
diff --git a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
index 359d8efd100ba..711444fa9bcdc 100644
--- a/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/IntegerTypesCheck.cpp
@@ -172,8 +172,8 @@ void IntegerTypesCheck::check(const MatchFinder::MatchResult &Result) {
// We don't add a fix-it as changing the type can easily break code,
// e.g. when a function requires a 'long' argument on all platforms.
// QualTypes are printed with implicit quotes.
- diag(Loc, "consider replacing %0 with '%1'") << BuiltinLoc.getType()
- << Replacement;
+ diag(Loc, "consider replacing %0 with '%1'")
+ << BuiltinLoc.getType() << Replacement;
}
} // namespace tidy::google::runtime
diff --git a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
index 3db27868fccaf..c1e421308d77d 100644
--- a/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/UnnamedNamespaceInHeaderCheck.cpp
@@ -21,8 +21,8 @@ UnnamedNamespaceInHeaderCheck::UnnamedNamespaceInHeaderCheck(
void UnnamedNamespaceInHeaderCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
- Finder->addMatcher(namespaceDecl(isAnonymous()).bind("anonymousNamespace"),
- this);
+ Finder->addMatcher(namespaceDecl(isAnonymous()).bind("anonymousNamespace"),
+ this);
}
void UnnamedNamespaceInHeaderCheck::check(
diff --git a/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp b/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp
index e9734e54a13e2..26d27c19f489e 100644
--- a/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp
+++ b/clang-tools-extra/clang-tidy/google/UsingNamespaceDirectiveCheck.cpp
@@ -16,7 +16,7 @@ namespace clang::tidy::google::build {
void UsingNamespaceDirectiveCheck::registerMatchers(
ast_matchers::MatchFinder *Finder) {
- Finder->addMatcher(usingDirectiveDecl().bind("usingNamespace"), this);
+ Finder->addMatcher(usingDirectiveDecl().bind("usingNamespace"), this);
}
void UsingNamespaceDirectiveCheck::check(
More information about the cfe-commits
mailing list