Skip to content

Commit d08a76d

Browse files
committed
Fix warnings discovered by #87348 [-Wunused-but-set-variable]
1 parent 8389b3b commit d08a76d

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2511,6 +2511,7 @@ unsigned ByteCodeExprGen<Emitter>::allocateLocalPrimitive(DeclTy &&Src,
25112511
dyn_cast_if_present<ValueDecl>(Src.dyn_cast<const Decl *>())) {
25122512
assert(!P.getGlobal(VD));
25132513
assert(!Locals.contains(VD));
2514+
(void)VD;
25142515
}
25152516

25162517
// FIXME: There are cases where Src.is<Expr*>() is wrong, e.g.

clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ void Environment::setValue(const Expr &E, Value &Val) {
850850
if (auto *RecordVal = dyn_cast<RecordValue>(&Val)) {
851851
assert(isOriginalRecordConstructor(CanonE) ||
852852
&RecordVal->getLoc() == &getResultObjectLocation(CanonE));
853+
(void)RecordVal;
853854
}
854855

855856
assert(CanonE.isPRValue());

clang/lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6354,6 +6354,7 @@ Sema::EvaluateConvertedConstantExpression(Expr *E, QualType T, APValue &Value,
63546354
// by this point.
63556355
assert(CE->getResultStorageKind() != ConstantResultStorageKind::None &&
63566356
"ConstantExpr has no value associated with it");
6357+
(void)CE;
63576358
} else {
63586359
E = ConstantExpr::Create(Context, Result.get(), Value);
63596360
}

llvm/lib/Transforms/Utils/BasicBlockUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ BasicBlock *llvm::SplitEdge(BasicBlock *BB, BasicBlock *Succ, DominatorTree *DT,
784784
// If the successor only has a single pred, split the top of the successor
785785
// block.
786786
assert(SP == BB && "CFG broken");
787-
SP = nullptr;
787+
(void)SP;
788788
return SplitBlock(Succ, &Succ->front(), DT, LI, MSSAU, BBName,
789789
/*Before=*/true);
790790
}

0 commit comments

Comments
 (0)