From 3acbe8145c60f4d1e7a180b4602a94269a489df5 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 27 Apr 2023 12:36:59 +0800 Subject: Fix most of the disabled warnings on gcc/clang (#2839) --- source/slang/slang-ir-specialize.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ir-specialize.cpp') diff --git a/source/slang/slang-ir-specialize.cpp b/source/slang/slang-ir-specialize.cpp index fb00a960f..5962f6dbb 100644 --- a/source/slang/slang-ir-specialize.cpp +++ b/source/slang/slang-ir-specialize.cpp @@ -409,7 +409,7 @@ struct SpecializationContext decor->getOp() == kIROp_UserDefinedBackwardDerivativeDecoration) { // If we already have a diff func on this specialize, skip. - if (auto specDiffRef = specInst->findDecorationImpl(decor->getOp())) + if (const auto specDiffRef = specInst->findDecorationImpl(decor->getOp())) { continue; } @@ -1051,7 +1051,7 @@ struct SpecializationContext // A subscript operation on mutable buffers returns a ptr type instead of a value type. // We need to make sure the pointer-ness is preserved correctly. auto innerResultType = elementType; - if (auto ptrResultType = as(inst->getDataType())) + if (const auto ptrResultType = as(inst->getDataType())) { innerResultType = builder.getPtrType(elementType); } -- cgit v1.2.3