-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[NFC] [clang] fix unused variable warning #126796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NFC] [clang] fix unused variable warning #126796
Conversation
Created using spr 1.3.4
@llvm/pr-subscribers-clang Author: Florian Mayer (fmayer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/126796.diff 1 Files Affected:
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
index 6452dedb8c391..1411bf1d1c237 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
@@ -156,7 +156,7 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
auto Name = safeGetName(Callee);
if (Name == "get" || Name == "ptr")
E = MCE->getImplicitObjectArgument();
- if (auto *CD = dyn_cast<CXXConversionDecl>(Callee))
+ if (dyn_cast<CXXConversionDecl>(Callee))
E = MCE->getImplicitObjectArgument();
}
} else if (auto *OCE = dyn_cast<CXXOperatorCallExpr>(E)) {
|
@llvm/pr-subscribers-clang-static-analyzer-1 Author: Florian Mayer (fmayer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/126796.diff 1 Files Affected:
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
index 6452dedb8c391..1411bf1d1c237 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/ASTUtils.cpp
@@ -156,7 +156,7 @@ bool isConstOwnerPtrMemberExpr(const clang::Expr *E) {
auto Name = safeGetName(Callee);
if (Name == "get" || Name == "ptr")
E = MCE->getImplicitObjectArgument();
- if (auto *CD = dyn_cast<CXXConversionDecl>(Callee))
+ if (dyn_cast<CXXConversionDecl>(Callee))
E = MCE->getImplicitObjectArgument();
}
} else if (auto *OCE = dyn_cast<CXXOperatorCallExpr>(E)) {
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think isa should be preferred if the result of dyncast is not used.
Same applied to the surrounding ifs too.
Ah, so this one is already merged. Then nvm. It's not worth a followup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops, thank you for the fix. It's odd that the checks didn't catch this before the merge...
|
No description provided.