[clang] isUncountedPtr should take QualType as an argument. (PR #110213)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 27 00:18:05 PDT 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 9a361684c80a779c28d8315503a423e05f0cc061 4c82195acf092fd9a92c999040f8f66947585fde --extensions cpp,h -- clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.h clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedCallArgsChecker.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLambdaCapturesChecker.cpp clang/lib/StaticAnalyzer/Checkers/WebKit/UncountedLocalVarsChecker.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
index 38582e6d54..c4cb8f7dfc 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/PtrTypesSemantics.cpp
@@ -165,8 +165,7 @@ std::optional<bool> isUncounted(const CXXRecordDecl* Class)
return (*IsRefCountable);
}
-std::optional<bool> isUncountedPtr(const QualType T)
-{
+std::optional<bool> isUncountedPtr(const QualType T) {
if (T->isPointerType() || T->isReferenceType()) {
if (auto *CXXRD = T->getPointeeCXXRecordDecl())
return isUncounted(CXXRD);
@@ -194,7 +193,7 @@ std::optional<bool> isGetterOfRefCounted(const CXXMethodDecl* M)
// FIXME: Currently allowing any Ref<T> -> whatever cast.
if (isRefType(className)) {
if (auto *maybeRefToRawOperator = dyn_cast<CXXConversionDecl>(M))
- return isUncountedPtr(maybeRefToRawOperator->getConversionType());
+ return isUncountedPtr(maybeRefToRawOperator->getConversionType());
}
}
return false;
``````````
</details>
https://github.com/llvm/llvm-project/pull/110213
More information about the cfe-commits
mailing list