Fix clang-tidy bugprone-parent-virtual-call warnings

This commit is contained in:
Tim Wojtulewicz 2025-04-17 11:53:10 -07:00
parent b3de432ef2
commit 74acc30258
4 changed files with 6 additions and 5 deletions

View file

@ -8,4 +8,5 @@ Checks: [-*,
bugprone-multi-level-implicit-pointer-conversion, bugprone-multi-level-implicit-pointer-conversion,
bugprone-inc-dec-in-conditions, bugprone-inc-dec-in-conditions,
bugprone-misplaced-widening-cast, bugprone-misplaced-widening-cast,
bugprone-parent-virtual-call,
] ]

View file

@ -1226,7 +1226,7 @@ ValPtr ForStmt::DoExec(Frame* f, Val* v, StmtFlowType& flow) {
bool ForStmt::IsPure() const { return e->IsPure() && body->IsPure(); } bool ForStmt::IsPure() const { return e->IsPure() && body->IsPure(); }
void ForStmt::StmtDescribe(ODesc* d) const { void ForStmt::StmtDescribe(ODesc* d) const {
Stmt::StmtDescribe(d); Stmt::StmtDescribe(d); // NOLINT(bugprone-parent-virtual-call)
if ( d->IsReadable() ) if ( d->IsReadable() )
d->Add("("); d->Add("(");
@ -1398,7 +1398,7 @@ ValPtr ReturnStmt::Exec(Frame* f, StmtFlowType& flow) {
} }
void ReturnStmt::StmtDescribe(ODesc* d) const { void ReturnStmt::StmtDescribe(ODesc* d) const {
Stmt::StmtDescribe(d); Stmt::StmtDescribe(d); // NOLINT(bugprone-parent-virtual-call)
if ( ! d->IsReadable() ) if ( ! d->IsReadable() )
d->Add(e != nullptr); d->Add(e != nullptr);
@ -1607,7 +1607,7 @@ ValPtr AssertStmt::Exec(Frame* f, StmtFlowType& flow) {
} }
void AssertStmt::StmtDescribe(ODesc* d) const { void AssertStmt::StmtDescribe(ODesc* d) const {
Stmt::StmtDescribe(d); Stmt::StmtDescribe(d); // NOLINT(bugprone-parent-virtual-call)
// Quoting strings looks better when describing assert // Quoting strings looks better when describing assert
// statements. So turn it on explicitly. // statements. So turn it on explicitly.

View file

@ -57,7 +57,7 @@ void TCPSessionAdapter::Init() {
} }
void TCPSessionAdapter::Done() { void TCPSessionAdapter::Done() {
Analyzer::Done(); IP::SessionAdapter::Done();
if ( run_state::terminating && connection_pending && is_active && ! BothClosed() ) if ( run_state::terminating && connection_pending && is_active && ! BothClosed() )
Event(connection_pending); Event(connection_pending);

View file

@ -1281,7 +1281,7 @@ StmtPtr CheckAnyLenStmt::DoReduce(Reducer* c) {
} }
void CheckAnyLenStmt::StmtDescribe(ODesc* d) const { void CheckAnyLenStmt::StmtDescribe(ODesc* d) const {
Stmt::StmtDescribe(d); Stmt::StmtDescribe(d); // NOLINT(bugprone-parent-virtual-call)
e->Describe(d); e->Describe(d);
if ( ! d->IsBinary() ) if ( ! d->IsBinary() )