Skip to content

Commit

Permalink
enabled and mitigated `cppcoreguidelines-pro-type-static-cast-downcas…
Browse files Browse the repository at this point in the history
…t` clang-tidy warnings (#6670)
  • Loading branch information
firewave committed Aug 8, 2024
1 parent 26a266a commit 4e461bd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ Checks: >
-openmp-*,
-zircon-*,
cert-err34-c,
google-explicit-constructor,
cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-rvalue-reference-param-not-moved,
google-explicit-constructor,
-bugprone-assignment-in-if-condition,
-bugprone-branch-clone,
-bugprone-easily-swappable-parameters,
Expand Down
1 change: 0 additions & 1 deletion clang-tidy.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ To be evaluated (need to remove exclusion).
`cppcoreguidelines-avoid-const-or-ref-data-members`<br/>
`cppcoreguidelines-macro-usage`<br/>
`cppcoreguidelines-pro-type-member-init`<br/>
`cppcoreguidelines-pro-type-static-cast-downcast`<br/>
`cppcoreguidelines-prefer-member-initializer`<br/>
`cppcoreguidelines-misleading-capture-default-by-value`<br/>
`bugprone-argument-comment.CommentBoolLiterals`<br/>
Expand Down
2 changes: 1 addition & 1 deletion gui/librarydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ CppcheckLibraryData::Function *LibraryDialog::currentFunction()
QList<QListWidgetItem *> selitems = mUi->functions->selectedItems();
if (selitems.count() != 1)
return nullptr;
return static_cast<FunctionListItem *>(selitems.first())->function;
return dynamic_cast<FunctionListItem *>(selitems.first())->function;
}

void LibraryDialog::openCfg()
Expand Down

0 comments on commit 4e461bd

Please sign in to comment.