Skip to content

Commit f09aaa9

Browse files
committed
Sema: Address -Wunused-but-set-variable warnings.
1 parent 681463a commit f09aaa9

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
@@ -5282,8 +5282,7 @@ void AttributeChecker::checkBackDeployedAttrs(
52825282

52835283
// Unavailable decls cannot be back deployed.
52845284
auto backDeployedDomain = AvailabilityDomain::forPlatform(Attr->Platform);
5285-
if (auto unavailableDomain =
5286-
availability.containsUnavailableDomain(backDeployedDomain)) {
5285+
if (availability.containsUnavailableDomain(backDeployedDomain)) {
52875286
auto domainForDiagnostics = backDeployedDomain;
52885287
llvm::VersionTuple ignoredVersion;
52895288

0 commit comments

Comments
 (0)