Skip to content

Commit 15ae94d

Browse files
committed
Sema: Address -Wunused-but-set-variable warnings.
1 parent 04c0de6 commit 15ae94d

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ namespace {
194194
}
195195

196196
if (auto DRE = dyn_cast<DeclRefExpr>(expr)) {
197-
if (auto varDecl = dyn_cast<VarDecl>(DRE->getDecl())) {
197+
if (isa<VarDecl>(DRE->getDecl())) {
198198
if (CS.hasType(DRE)) {
199199
LTI.collectedTypes.insert(CS.getType(DRE).getPointer());
200200
}

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10834,7 +10834,7 @@ static ConstraintFix *validateInitializerRef(ConstraintSystem &cs,
1083410834
// which means MetatypeType has to be added after finding a type variable.
1083510835
if (baseLocator->isLastElement<LocatorPathElt::MemberRefBase>())
1083610836
baseType = MetatypeType::get(baseType);
10837-
} else if (auto *keyPathExpr = getAsExpr<KeyPathExpr>(anchor)) {
10837+
} else if (getAsExpr<KeyPathExpr>(anchor)) {
1083810838
// Key path can't refer to initializers e.g. `\Type.init`
1083910839
return AllowInvalidRefInKeyPath::forRef(cs, baseType, init, locator);
1084010840
}

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5154,8 +5154,7 @@ void AttributeChecker::checkBackDeployedAttrs(
51545154

51555155
// Unavailable decls cannot be back deployed.
51565156
auto backDeployedDomain = AvailabilityDomain::forPlatform(Attr->Platform);
5157-
if (auto unavailableDomain =
5158-
availability.containsUnavailableDomain(backDeployedDomain)) {
5157+
if (availability.containsUnavailableDomain(backDeployedDomain)) {
51595158
auto domainForDiagnostics = backDeployedDomain;
51605159
llvm::VersionTuple ignoredVersion;
51615160

0 commit comments

Comments
 (0)