mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
clang-tidy: bugprone-virtual-near-miss
A few virtual functions are called by constructors or destructors, which is dangerous in C++ (as an overridden virtual impl won't be called, only the one in the current class). Fix by either marking the function final or not calling at all (if possible).
This commit is contained in:
@@ -48,7 +48,7 @@ class TCPAcceptor : public NetworkAcceptor {
|
||||
~TCPAcceptor() override;
|
||||
|
||||
int start() override;
|
||||
void shutdown() override;
|
||||
void shutdown() final;
|
||||
std::unique_ptr<NetworkStream> accept() override;
|
||||
};
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ class raw_fd_istream : public raw_istream {
|
||||
size_t bufSize = 4096);
|
||||
raw_fd_istream(int fd, bool shouldClose, size_t bufSize = 4096);
|
||||
~raw_fd_istream() override;
|
||||
void close() override;
|
||||
void close() final;
|
||||
size_t in_avail() const override;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user