[clang-tools-extra] [clang-tidy][NFC] run clang-format over 'android', 'boost' and 'bugprone' checks (PR #143315)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 8 09:29:42 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-tidy
@llvm/pr-subscribers-clang-tools-extra
Author: Baranov Victor (vbvictor)
<details>
<summary>Changes</summary>
---
Patch is 29.29 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/143315.diff
28 Files Affected:
- (modified) clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp (+2-1)
- (modified) clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp (+4-5)
- (modified) clang-tools-extra/clang-tidy/android/CloexecCheck.cpp (+1-1)
- (modified) clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp (+4-5)
- (modified) clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp (+4-5)
- (modified) clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp (+5-6)
- (modified) clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp (+4-4)
- (modified) clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp (+7-7)
- (modified) clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp (+5-6)
- (modified) clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp (+7-5)
- (modified) clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp (+5-7)
- (modified) clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp (+1-1)
- (modified) clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp (+4-5)
- (modified) clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp (+4-5)
- (modified) clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp (+1-1)
- (modified) clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h (+2-1)
- (modified) clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp (+2-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp (+2-4)
- (modified) clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp (+1-1)
- (modified) clang-tools-extra/clang-tidy/bugprone/PosixReturnCheck.h (+1-1)
- (modified) clang-tools-extra/clang-tidy/bugprone/RedundantBranchConditionCheck.cpp (+3-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/SignalHandlerCheck.cpp (+8-4)
- (modified) clang-tools-extra/clang-tidy/bugprone/SpuriouslyWakeUpFunctionsCheck.h (+3-3)
- (modified) clang-tools-extra/clang-tidy/bugprone/StringLiteralWithEmbeddedNulCheck.cpp (+3-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.h (+2-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/SuspiciousMemsetUsageCheck.cpp (+1-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/SuspiciousSemicolonCheck.cpp (+1-2)
- (modified) clang-tools-extra/clang-tidy/bugprone/UndelegatedConstructorCheck.cpp (+1-1)
``````````diff
diff --git a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
index 4541e926e8864..1cc17daded903 100644
--- a/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
+++ b/clang-tools-extra/clang-tidy/android/AndroidTidyModule.cpp
@@ -34,7 +34,8 @@ namespace android {
class AndroidModule : public ClangTidyModule {
public:
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
- CheckFactories.registerCheck<CloexecAccept4Check>("android-cloexec-accept4");
+ CheckFactories.registerCheck<CloexecAccept4Check>(
+ "android-cloexec-accept4");
CheckFactories.registerCheck<CloexecAcceptCheck>("android-cloexec-accept");
CheckFactories.registerCheck<CloexecCreatCheck>("android-cloexec-creat");
CheckFactories.registerCheck<CloexecDupCheck>("android-cloexec-dup");
diff --git a/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp
index 8c34ecd6945c6..c90fc7ba1bb04 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecAcceptCheck.cpp
@@ -26,11 +26,10 @@ void CloexecAcceptCheck::registerMatchers(MatchFinder *Finder) {
}
void CloexecAcceptCheck::check(const MatchFinder::MatchResult &Result) {
- std::string ReplacementText =
- (Twine("accept4(") + getSpellingArg(Result, 0) + ", " +
- getSpellingArg(Result, 1) + ", " + getSpellingArg(Result, 2) +
- ", SOCK_CLOEXEC)")
- .str();
+ std::string ReplacementText = (Twine("accept4(") + getSpellingArg(Result, 0) +
+ ", " + getSpellingArg(Result, 1) + ", " +
+ getSpellingArg(Result, 2) + ", SOCK_CLOEXEC)")
+ .str();
replaceFunc(
Result,
diff --git a/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp
index 39a0d74f38360..f4d657a7f4e90 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecCheck.cpp
@@ -36,7 +36,7 @@ std::string buildFixMsgForStringFlag(const Expr *Arg, const SourceManager &SM,
const char *CloexecCheck::FuncDeclBindingStr = "funcDecl";
-const char *CloexecCheck::FuncBindingStr ="func";
+const char *CloexecCheck::FuncBindingStr = "func";
void CloexecCheck::registerMatchersImpl(
MatchFinder *Finder, internal::Matcher<FunctionDecl> Function) {
diff --git a/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp
index ee270209e4fa6..8d9f45c3567f2 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecCreatCheck.cpp
@@ -16,11 +16,10 @@ namespace clang::tidy::android {
void CloexecCreatCheck::registerMatchers(MatchFinder *Finder) {
auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter())));
auto MODETType = hasType(namedDecl(hasName("mode_t")));
- registerMatchersImpl(Finder,
- functionDecl(isExternC(), returns(isInteger()),
- hasName("creat"),
- hasParameter(0, CharPointerType),
- hasParameter(1, MODETType)));
+ registerMatchersImpl(Finder, functionDecl(isExternC(), returns(isInteger()),
+ hasName("creat"),
+ hasParameter(0, CharPointerType),
+ hasParameter(1, MODETType)));
}
void CloexecCreatCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp
index 153e7af82d15c..bb9d0d2cb3da3 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecFopenCheck.cpp
@@ -15,11 +15,10 @@ namespace clang::tidy::android {
void CloexecFopenCheck::registerMatchers(MatchFinder *Finder) {
auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter())));
- registerMatchersImpl(Finder,
- functionDecl(isExternC(), returns(asString("FILE *")),
- hasName("fopen"),
- hasParameter(0, CharPointerType),
- hasParameter(1, CharPointerType)));
+ registerMatchersImpl(
+ Finder, functionDecl(isExternC(), returns(asString("FILE *")),
+ hasName("fopen"), hasParameter(0, CharPointerType),
+ hasParameter(1, CharPointerType)));
}
void CloexecFopenCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp
index 11807f95def47..623b6ab02e7ba 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecOpenCheck.cpp
@@ -20,12 +20,11 @@ void CloexecOpenCheck::registerMatchers(MatchFinder *Finder) {
hasAnyName("open", "open64"),
hasParameter(0, CharPointerType),
hasParameter(1, hasType(isInteger()))));
- registerMatchersImpl(Finder,
- functionDecl(isExternC(), returns(isInteger()),
- hasName("openat"),
- hasParameter(0, hasType(isInteger())),
- hasParameter(1, CharPointerType),
- hasParameter(2, hasType(isInteger()))));
+ registerMatchersImpl(
+ Finder, functionDecl(isExternC(), returns(isInteger()), hasName("openat"),
+ hasParameter(0, hasType(isInteger())),
+ hasParameter(1, CharPointerType),
+ hasParameter(2, hasType(isInteger()))));
}
void CloexecOpenCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp b/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp
index 2798c80146e90..e32332bdfc953 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecPipe2Check.cpp
@@ -14,10 +14,10 @@ using namespace clang::ast_matchers;
namespace clang::tidy::android {
void CloexecPipe2Check::registerMatchers(MatchFinder *Finder) {
- registerMatchersImpl(Finder,
- functionDecl(returns(isInteger()), hasName("pipe2"),
- hasParameter(0, hasType(pointsTo(isInteger()))),
- hasParameter(1, hasType(isInteger()))));
+ registerMatchersImpl(
+ Finder, functionDecl(returns(isInteger()), hasName("pipe2"),
+ hasParameter(0, hasType(pointsTo(isInteger()))),
+ hasParameter(1, hasType(isInteger()))));
}
void CloexecPipe2Check::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp
index 9085be67b755e..c59b127dc87ac 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecPipeCheck.cpp
@@ -14,19 +14,19 @@ using namespace clang::ast_matchers;
namespace clang::tidy::android {
void CloexecPipeCheck::registerMatchers(MatchFinder *Finder) {
- registerMatchersImpl(Finder,
- functionDecl(returns(isInteger()), hasName("pipe"),
- hasParameter(0, hasType(pointsTo(isInteger())))));
+ registerMatchersImpl(
+ Finder, functionDecl(returns(isInteger()), hasName("pipe"),
+ hasParameter(0, hasType(pointsTo(isInteger())))));
}
void CloexecPipeCheck::check(const MatchFinder::MatchResult &Result) {
std::string ReplacementText =
(Twine("pipe2(") + getSpellingArg(Result, 0) + ", O_CLOEXEC)").str();
- replaceFunc(
- Result,
- "prefer pipe2() with O_CLOEXEC to avoid leaking file descriptors to child processes",
- ReplacementText);
+ replaceFunc(Result,
+ "prefer pipe2() with O_CLOEXEC to avoid leaking file descriptors "
+ "to child processes",
+ ReplacementText);
}
} // namespace clang::tidy::android
diff --git a/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp b/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp
index 65c6a82036cc5..12b31a050c2c0 100644
--- a/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp
+++ b/clang-tools-extra/clang-tidy/android/CloexecSocketCheck.cpp
@@ -14,12 +14,11 @@ using namespace clang::ast_matchers;
namespace clang::tidy::android {
void CloexecSocketCheck::registerMatchers(MatchFinder *Finder) {
- registerMatchersImpl(Finder,
- functionDecl(isExternC(), returns(isInteger()),
- hasName("socket"),
- hasParameter(0, hasType(isInteger())),
- hasParameter(1, hasType(isInteger())),
- hasParameter(2, hasType(isInteger()))));
+ registerMatchersImpl(
+ Finder, functionDecl(isExternC(), returns(isInteger()), hasName("socket"),
+ hasParameter(0, hasType(isInteger())),
+ hasParameter(1, hasType(isInteger())),
+ hasParameter(2, hasType(isInteger()))));
}
void CloexecSocketCheck::check(const MatchFinder::MatchResult &Result) {
diff --git a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
index 93f35cb2c1a3d..d99e17c691485 100644
--- a/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/DynamicStaticInitializersCheck.cpp
@@ -36,16 +36,18 @@ void DynamicStaticInitializersCheck::registerMatchers(MatchFinder *Finder) {
this);
}
-void DynamicStaticInitializersCheck::check(const MatchFinder::MatchResult &Result) {
+void DynamicStaticInitializersCheck::check(
+ const MatchFinder::MatchResult &Result) {
const auto *Var = Result.Nodes.getNodeAs<VarDecl>("var");
SourceLocation Loc = Var->getLocation();
- if (!Loc.isValid() || !utils::isPresumedLocInHeaderFile(Loc, *Result.SourceManager,
- HeaderFileExtensions))
+ if (!Loc.isValid() || !utils::isPresumedLocInHeaderFile(
+ Loc, *Result.SourceManager, HeaderFileExtensions))
return;
// If the initializer is a constant expression, then the compiler
// doesn't have to dynamically initialize it.
- diag(Loc, "static variable %0 may be dynamically initialized in this header file")
- << Var;
+ diag(Loc,
+ "static variable %0 may be dynamically initialized in this header file")
+ << Var;
}
} // namespace clang::tidy::bugprone
diff --git a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp
index 7626bf89e694c..92425890a0ea8 100644
--- a/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/InaccurateEraseCheck.cpp
@@ -18,9 +18,9 @@ void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) {
const auto EndCall =
callExpr(
callee(functionDecl(hasAnyName("remove", "remove_if", "unique"))),
- hasArgument(
- 1, optionally(cxxMemberCallExpr(callee(cxxMethodDecl(hasName("end"))))
- .bind("end"))))
+ hasArgument(1, optionally(cxxMemberCallExpr(
+ callee(cxxMethodDecl(hasName("end"))))
+ .bind("end"))))
.bind("alg");
const auto DeclInStd = type(hasUnqualifiedDesugaredType(
@@ -35,10 +35,8 @@ void InaccurateEraseCheck::registerMatchers(MatchFinder *Finder) {
}
void InaccurateEraseCheck::check(const MatchFinder::MatchResult &Result) {
- const auto *MemberCall =
- Result.Nodes.getNodeAs<CXXMemberCallExpr>("erase");
- const auto *EndExpr =
- Result.Nodes.getNodeAs<CXXMemberCallExpr>("end");
+ const auto *MemberCall = Result.Nodes.getNodeAs<CXXMemberCallExpr>("erase");
+ const auto *EndExpr = Result.Nodes.getNodeAs<CXXMemberCallExpr>("end");
const SourceLocation Loc = MemberCall->getBeginLoc();
FixItHint Hint;
diff --git a/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
index 2a8d36215cc74..c2b0732a3e7bd 100644
--- a/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/IncorrectRoundingsCheck.cpp
@@ -1,4 +1,4 @@
-//===--- IncorrectRoundingsCheck.cpp - clang-tidy ------------------------------===//
+//===--- IncorrectRoundingsCheck.cpp - clang-tidy--------------------------===//
//
// 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/bugprone/InfiniteLoopCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
index b7f0c08b2a7d4..07116a7ff15f5 100644
--- a/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/InfiniteLoopCheck.cpp
@@ -83,8 +83,8 @@ static bool isVarThatIsPossiblyChanged(const Decl *Func, const Stmt *LoopStmt,
isChanged(LoopStmt, Var, Context);
// FIXME: Track references.
}
- } else if (isa<MemberExpr, CallExpr,
- ObjCIvarRefExpr, ObjCPropertyRefExpr, ObjCMessageExpr>(Cond)) {
+ } else if (isa<MemberExpr, CallExpr, ObjCIvarRefExpr, ObjCPropertyRefExpr,
+ ObjCMessageExpr>(Cond)) {
// FIXME: Handle MemberExpr.
return true;
} else if (const auto *CE = dyn_cast<CastExpr>(Cond)) {
@@ -274,8 +274,7 @@ static bool hasRecursionOverStaticLoopCondVariables(const Expr *Cond,
void InfiniteLoopCheck::registerMatchers(MatchFinder *Finder) {
const auto LoopCondition = allOf(
- hasCondition(
- expr(forCallable(decl().bind("func"))).bind("condition")),
+ hasCondition(expr(forCallable(decl().bind("func"))).bind("condition")),
unless(hasBody(hasDescendant(
loopEndingStmt(forCallable(equalsBoundNode("func")))))));
@@ -324,7 +323,7 @@ void InfiniteLoopCheck::check(const MatchFinder::MatchResult &Result) {
diag(LoopStmt->getBeginLoc(),
"this loop is infinite; none of its condition variables (%0)"
" are updated in the loop body")
- << CondVarNames;
+ << CondVarNames;
}
}
diff --git a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
index 32f5edddfe80b..6d5c470616d1d 100644
--- a/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/LambdaFunctionNameCheck.cpp
@@ -34,12 +34,11 @@ class MacroExpansionsWithFileAndLine : public PPCallbacks {
LambdaFunctionNameCheck::SourceRangeSet *SME)
: SuppressMacroExpansions(SME) {}
- void MacroExpands(const Token &MacroNameTok,
- const MacroDefinition &MD, SourceRange Range,
- const MacroArgs *Args) override {
+ void MacroExpands(const Token &MacroNameTok, const MacroDefinition &MD,
+ SourceRange Range, const MacroArgs *Args) override {
bool HasFile = false;
bool HasLine = false;
- for (const auto& T : MD.getMacroInfo()->tokens()) {
+ for (const Token &T : MD.getMacroInfo()->tokens()) {
if (T.is(tok::identifier)) {
StringRef IdentName = T.getIdentifierInfo()->getName();
if (IdentName == "__FILE__") {
@@ -55,7 +54,7 @@ class MacroExpansionsWithFileAndLine : public PPCallbacks {
}
private:
- LambdaFunctionNameCheck::SourceRangeSet* SuppressMacroExpansions;
+ LambdaFunctionNameCheck::SourceRangeSet *SuppressMacroExpansions;
};
AST_MATCHER(CXXMethodDecl, isInLambda) { return Node.getParent()->isLambda(); }
diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
index 40e4ab6c8b12a..5b166b4b3a9bf 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.cpp
@@ -74,7 +74,7 @@ void MisplacedOperatorInStrlenInAllocCheck::check(
if (!Alloc)
Alloc = Result.Nodes.getNodeAs<CXXNewExpr>("Alloc");
assert(Alloc && "Matched node bound by 'Alloc' should be either 'CallExpr'"
- " or 'CXXNewExpr'");
+ " or 'CXXNewExpr'");
const auto *StrLen = Result.Nodes.getNodeAs<CallExpr>("StrLen");
const auto *BinOp = Result.Nodes.getNodeAs<BinaryOperator>("BinOp");
diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
index 3a09ddb4a6c03..93cf50d0b1c6f 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
+++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedOperatorInStrlenInAllocCheck.h
@@ -21,7 +21,8 @@ namespace clang::tidy::bugprone {
/// http://clang.llvm.org/extra/clang-tidy/checks/bugprone/misplaced-operator-in-strlen-in-alloc.html
class MisplacedOperatorInStrlenInAllocCheck : public ClangTidyCheck {
public:
- MisplacedOperatorInStrlenInAllocCheck(StringRef Name, ClangTidyContext *Context)
+ MisplacedOperatorInStrlenInAllocCheck(StringRef Name,
+ ClangTidyContext *Context)
: ClangTidyCheck(Name, Context) {}
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
diff --git a/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
index b9129fa0811c6..86785d36696dc 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MisplacedPointerArithmeticInAllocCheck.cpp
@@ -76,8 +76,8 @@ void MisplacedPointerArithmeticInAllocCheck::check(
} else {
const auto *CtrE = New->getConstructExpr();
if (!CtrE || !CtrE->getArg(CtrE->getNumArgs() - 1)
- ->getType()
- ->isIntegralOrEnumerationType())
+ ->getType()
+ ->isIntegralOrEnumerationType())
return;
CallName = "operator new";
}
diff --git a/clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp
index 41191a3cfed23..6d75a8262b5bc 100644
--- a/clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp
@@ -95,16 +95,14 @@ void MultipleNewInOneExpressionCheck::registerMatchers(MatchFinder *Finder) {
Finder->addMatcher(
callExpr(
- hasAnyArgument(
- expr(HasNewExpr1).bind("arg1")),
+ hasAnyArgument(expr(HasNewExpr1).bind("arg1")),
hasAnyArgument(
expr(HasNewExpr2, unless(equalsBoundNode("arg1"))).bind("arg2")),
hasAncestor(BadAllocCatchingTryBlock)),
this);
Finder->addMatcher(
cxxConstructExpr(
- hasAnyArgument(
- expr(HasNewExpr1).bind("arg1")),
+ hasAnyArgument(expr(HasNewExpr1).bind("arg1")),
hasAnyArgument(
expr(HasNewExpr2, unless(equalsBoundNode("arg1"))).bind("ar...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/143315
More information about the cfe-commits
mailing list