mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +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:
@@ -172,16 +172,16 @@ class AnalogGyro : public GyroBase {
|
||||
* significant drift in the gyro and it needs to be recalibrated after it has
|
||||
* been running.
|
||||
*/
|
||||
void Reset() override;
|
||||
void Reset() final;
|
||||
|
||||
/**
|
||||
* Initialize the gyro.
|
||||
*
|
||||
* Calibration is handled by Calibrate().
|
||||
*/
|
||||
virtual void InitGyro();
|
||||
void InitGyro();
|
||||
|
||||
void Calibrate() override;
|
||||
void Calibrate() final;
|
||||
|
||||
/**
|
||||
* Gets the analog input for the gyro.
|
||||
|
||||
Reference in New Issue
Block a user