Skip to content

Commit 5dc7a20

Browse files
committed
Sema: Address -Wunused-but-set-variable warnings.
1 parent 0c69e2d commit 5dc7a20

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
@@ -10849,7 +10849,7 @@ static ConstraintFix *validateInitializerRef(ConstraintSystem &cs,
1084910849
// which means MetatypeType has to be added after finding a type variable.
1085010850
if (baseLocator->isLastElement<LocatorPathElt::MemberRefBase>())
1085110851
baseType = MetatypeType::get(baseType);
10852-
} else if (auto *keyPathExpr = getAsExpr<KeyPathExpr>(anchor)) {
10852+
} else if (getAsExpr<KeyPathExpr>(anchor)) {
1085310853
// Key path can't refer to initializers e.g. `\Type.init`
1085410854
return AllowInvalidRefInKeyPath::forRef(cs, baseType, init, locator);
1085510855
}

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)