From 8c01313b18bd6b5ac915fc1d752f79ae3aafc292 Mon Sep 17 00:00:00 2001 From: MikePopoloski Date: Sat, 23 Sep 2023 09:52:43 -0400 Subject: [PATCH] Fix new clang-tidy warnings --- source/ast/symbols/BlockSymbols.cpp | 4 ++-- source/ast/types/AllTypes.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ast/symbols/BlockSymbols.cpp b/source/ast/symbols/BlockSymbols.cpp index 4ed5d60ba..01e613969 100644 --- a/source/ast/symbols/BlockSymbols.cpp +++ b/source/ast/symbols/BlockSymbols.cpp @@ -611,10 +611,10 @@ GenerateBlockArraySymbol& GenerateBlockArraySymbol::fromSyntax(Compilation& comp } SmallVector entries; - auto createBlock = [&, loc = loc](ConstantValue value, bool isUninstantiated) { + auto createBlock = [&, blockLoc = loc](ConstantValue value, bool isUninstantiated) { // Spec: each generate block gets their own scope, with an implicit // localparam of the same name as the genvar. - auto block = compilation.emplace(compilation, "", loc, + auto block = compilation.emplace(compilation, "", blockLoc, (uint32_t)entries.size(), isUninstantiated); auto implicitParam = compilation.emplace( diff --git a/source/ast/types/AllTypes.cpp b/source/ast/types/AllTypes.cpp index f119bb80b..65b3e40ff 100644 --- a/source/ast/types/AllTypes.cpp +++ b/source/ast/types/AllTypes.cpp @@ -995,7 +995,7 @@ const Type& PackedUnionType::fromSyntax(Compilation& comp, const StructUnionType // In tagged unions the tag contributes to the total number of packed bits. if (isTagged && fieldIndex) { - unionType->tagBits = std::bit_width(fieldIndex - 1); + unionType->tagBits = (uint32_t)std::bit_width(fieldIndex - 1); unionType->bitWidth += unionType->tagBits; }