[clang-tools-extra] [clang-tidy][NFC] fix typo in ExceptionAnalyzer; `replace count()>0` with `contains` (PR #116635)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 18 07:11:39 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 3f9d02aae87b7c778b86cb79ebd4b64760653079 74c7a62a93c435a25fa524b1d1ede1fc9fe40a07 --extensions cpp,h -- clang-tools-extra/clang-tidy/bugprone/ExceptionEscapeCheck.cpp clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
index 431dcb5210..68f3ecf6bd 100644
--- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
+++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp
@@ -449,7 +449,8 @@ void ExceptionAnalyzer::ExceptionInfo::reevaluateBehaviour() {
ExceptionAnalyzer::ExceptionInfo ExceptionAnalyzer::throwsException(
const FunctionDecl *Func, const ExceptionInfo::Throwables &Caught,
llvm::SmallSet<const FunctionDecl *, 32> &CallStack) {
- if (!Func || CallStack.contains(Func) || (!CallStack.empty() && !canThrow(Func)))
+ if (!Func || CallStack.contains(Func) ||
+ (!CallStack.empty() && !canThrow(Func)))
return ExceptionInfo::createNonThrowing();
if (const Stmt *Body = Func->getBody()) {
diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
index d8471f4d4c..6c2d693d64 100644
--- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
+++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.h
@@ -101,8 +101,8 @@ public:
/// Recalculate the 'Behaviour' for example after filtering.
void reevaluateBehaviour();
- /// Keep track if the entity related to this 'ExceptionInfo' can in principle
- /// throw, if it's unknown or if it won't throw.
+ /// Keep track if the entity related to this 'ExceptionInfo' can in
+ /// principle throw, if it's unknown or if it won't throw.
State Behaviour;
/// Keep track if the entity contains any unknown elements to keep track
``````````
</details>
https://github.com/llvm/llvm-project/pull/116635
More information about the cfe-commits
mailing list