Skip to content

Commit c2647ed

Browse files
committed
fix unused variables in condition warning
for 92023b1
1 parent e544d9c commit c2647ed

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

clang/include/clang/AST/DeclTemplate.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ class DefaultArgStorage {
377377
InheritedFrom = getParmOwningDefaultArg(InheritedFrom);
378378
if (!isSet())
379379
ValueOrInherited = InheritedFrom;
380-
else if (auto *D = ValueOrInherited.template dyn_cast<ParmDecl *>()) {
380+
else if ([[maybe_unused]] auto *D =
381+
ValueOrInherited.template dyn_cast<ParmDecl *>()) {
381382
assert(C.isSameDefaultTemplateArgument(D, InheritedFrom));
382383
ValueOrInherited =
383384
new (allocateDefaultArgStorageChain(C)) Chain{InheritedFrom, get()};

clang/lib/AST/Interp/ByteCodeExprGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,7 +1670,7 @@ template <class Emitter>
16701670
std::optional<unsigned>
16711671
ByteCodeExprGen<Emitter>::allocateLocal(DeclTy &&Src, bool IsExtended) {
16721672
// Make sure we don't accidentally register the same decl twice.
1673-
if (const auto *VD =
1673+
if ([[maybe_unused]] const auto *VD =
16741674
dyn_cast_if_present<ValueDecl>(Src.dyn_cast<const Decl *>())) {
16751675
assert(!P.getGlobal(VD));
16761676
assert(!Locals.contains(VD));

0 commit comments

Comments
 (0)