Fix clang-tidy bugprone-unused-local-non-trivial-variable warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-17 15:23:25 -07:00
parent 8bb015754a
commit d2045d1834
8 changed files with 1 additions and 7 deletions

View file

@ -15,4 +15,5 @@ Checks: [-*,
bugprone-suspicious-include, bugprone-suspicious-include,
bugprone-suspicious-realloc-usage, bugprone-suspicious-realloc-usage,
bugprone-throw-keyword-missing, bugprone-throw-keyword-missing,
bugprone-unused-local-non-trivial-variable,
] ]

View file

@ -485,7 +485,6 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
std::string loc_str; std::string loc_str;
if ( location ) { if ( location ) {
std::string loc_file = "";
int loc_line = 0; int loc_line = 0;
if ( locations.size() ) { if ( locations.size() ) {

View file

@ -53,7 +53,6 @@ refine connection IMAP_Conn += {
%{ %{
string cmdstr = std_str(command); string cmdstr = std_str(command);
std::transform(cmdstr.begin(), cmdstr.end(), cmdstr.begin(), ::tolower); std::transform(cmdstr.begin(), cmdstr.end(), cmdstr.begin(), ::tolower);
string tagstr = std_str(tag);
if ( !is_orig && cmdstr == "capability" && tag == "*" ) { if ( !is_orig && cmdstr == "capability" && tag == "*" ) {
return CMD_CAPABILITY; return CMD_CAPABILITY;

View file

@ -607,7 +607,6 @@ bool Raw::DoUpdate() {
} }
} }
std::string line;
assert((NumFields() == 1 && ! use_stderr) || (NumFields() == 2 && use_stderr)); assert((NumFields() == 1 && ! use_stderr) || (NumFields() == 2 && use_stderr));
for ( ;; ) { for ( ;; ) {
if ( stdin_towrite > 0 ) if ( stdin_towrite > 0 )

View file

@ -63,7 +63,6 @@ shared_ptr<CPP_InitInfo> CPPCompile::RegisterConstant(const ValPtr& vp, int& con
} }
auto tag = t->Tag(); auto tag = t->Tag();
auto const_name = const_info[tag]->NextName();
shared_ptr<CPP_InitInfo> gi; shared_ptr<CPP_InitInfo> gi;
switch ( tag ) { switch ( tag ) {

View file

@ -1241,7 +1241,6 @@ string CPPCompile::GenField(const ExprPtr& rec, int field) {
auto pt = processed_types.find(rt); auto pt = processed_types.find(rt);
ASSERT(pt != processed_types.end()); ASSERT(pt != processed_types.end());
auto rt_offset = pt->second->Offset(); auto rt_offset = pt->second->Offset();
string field_name = rt->FieldName(field);
field_decls.emplace_back(rt_offset, rt->FieldDecl(field)); field_decls.emplace_back(rt_offset, rt->FieldDecl(field));
if ( rfm != record_field_mappings.end() ) if ( rfm != record_field_mappings.end() )

View file

@ -491,7 +491,6 @@ ListTypeInfo::ListTypeInfo(CPPCompile* _c, TypePtr _t)
} }
void ListTypeInfo::AddInitializerVals(std::vector<std::string>& ivs) const { void ListTypeInfo::AddInitializerVals(std::vector<std::string>& ivs) const {
string type_list;
for ( auto& t : types ) { for ( auto& t : types ) {
auto iv = Fmt(c->TypeOffset(t)); auto iv = Fmt(c->TypeOffset(t));
ivs.emplace_back(iv); ivs.emplace_back(iv);

View file

@ -255,7 +255,6 @@ bool CSE_ValidityChecker::CheckTableRef(const TypePtr& t) { return CheckSideEffe
bool CSE_ValidityChecker::CheckCall(const CallExpr* c) { bool CSE_ValidityChecker::CheckCall(const CallExpr* c) {
auto func = c->Func(); auto func = c->Func();
std::string desc;
if ( func->Tag() != EXPR_NAME ) if ( func->Tag() != EXPR_NAME )
// Can't analyze indirect calls. // Can't analyze indirect calls.
return Invalid(); return Invalid();