[clang] 807d397 - [clang] Fix two unused variable warnings from if statements. NFC
Craig Topper via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 17 09:18:37 PDT 2023
Author: Craig Topper
Date: 2023-03-17T09:18:13-07:00
New Revision: 807d397c751355ae02a89cb5178192752b832203
URL: https://github.com/llvm/llvm-project/commit/807d397c751355ae02a89cb5178192752b832203
DIFF: https://github.com/llvm/llvm-project/commit/807d397c751355ae02a89cb5178192752b832203.diff
LOG: [clang] Fix two unused variable warnings from if statements. NFC
Added:
Modified:
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Sema/SemaExprMember.cpp
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index c40e93b4ad13..b6d57f077e55 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1993,7 +1993,7 @@ void Clang::AddMIPSTargetArgs(const ArgList &Args,
void Clang::AddPPCTargetArgs(const ArgList &Args,
ArgStringList &CmdArgs) const {
const llvm::Triple &T = getToolChain().getTriple();
- if (const Arg *A = Args.getLastArg(options::OPT_mtune_EQ)) {
+ if (Args.getLastArg(options::OPT_mtune_EQ)) {
CmdArgs.push_back("-tune-cpu");
std::string CPU = ppc::getPPCTuneCPU(Args, T);
CmdArgs.push_back(Args.MakeArgString(CPU));
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp
index 667a17e05f93..60b9b013d3f2 100644
--- a/clang/lib/Sema/SemaExprMember.cpp
+++ b/clang/lib/Sema/SemaExprMember.cpp
@@ -164,7 +164,7 @@ static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef,
if (auto *MD = dyn_cast<CXXMethodDecl>(DC))
contextClass = MD->getParent()->getCanonicalDecl();
else if (auto *RD = dyn_cast<CXXRecordDecl>(DC))
- contextClass = cast<CXXRecordDecl>(DC);
+ contextClass = RD;
else
return AbstractInstanceResult ? AbstractInstanceResult
: IMA_Error_StaticContext;
More information about the cfe-commits
mailing list