Modernise code to use override specifier
Generated by clang-tidy.
Test: m checkbuild
Change-Id: I8e23da6b8af31b291be2eefe9937ca222ea8a8c3
diff --git a/benchmarks/semaphore_benchmark.cpp b/benchmarks/semaphore_benchmark.cpp
index ba89137..cf51489 100644
--- a/benchmarks/semaphore_benchmark.cpp
+++ b/benchmarks/semaphore_benchmark.cpp
@@ -80,7 +80,7 @@
class SemaphoreFixture : public benchmark::Fixture {
public:
- void SetUp(const benchmark::State&) {
+ void SetUp(const benchmark::State&) override {
sem_init(&semaphore, 0, 0);
pthread_attr_t attr;
@@ -100,7 +100,7 @@
setup = true;
}
- ~SemaphoreFixture() {
+ ~SemaphoreFixture() override {
if (setup) {
// Only do this if the test was actually run.
sched_setscheduler(0, SCHED_OTHER, ¶m);
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index 7949d0f..1bc5030 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -67,7 +67,7 @@
class DlExtTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
handle_ = nullptr;
// verify that we don't have the library loaded already
void* h = dlopen(kLibName, RTLD_NOW | RTLD_NOLOAD);
@@ -78,7 +78,7 @@
ASSERT_EQ(std::string("dlopen failed: library \"") + kLibNameNoRelro + "\" wasn't loaded and RTLD_NOLOAD prevented it", dlerror());
}
- virtual void TearDown() {
+ void TearDown() override {
if (handle_ != nullptr) {
ASSERT_DL_ZERO(dlclose(handle_));
}
@@ -418,7 +418,7 @@
class DlExtRelroSharingTest : public DlExtTest {
protected:
- virtual void SetUp() {
+ void SetUp() override {
DlExtTest::SetUp();
void* start = mmap(nullptr, kLibSize, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
ASSERT_TRUE(start != MAP_FAILED);
@@ -428,7 +428,7 @@
extinfo_.relro_fd = -1;
}
- virtual void TearDown() {
+ void TearDown() override {
DlExtTest::TearDown();
}
diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp
index 9b3dba0..90539fe 100644
--- a/tests/sys_ptrace_test.cpp
+++ b/tests/sys_ptrace_test.cpp
@@ -402,7 +402,7 @@
}
}
- ~PtraceResumptionTest() {
+ ~PtraceResumptionTest() override {
}
void AssertDeath(int signo);
diff --git a/tests/sys_resource_test.cpp b/tests/sys_resource_test.cpp
index 0b6b6ef..b1e8b1a 100644
--- a/tests/sys_resource_test.cpp
+++ b/tests/sys_resource_test.cpp
@@ -30,7 +30,7 @@
class SysResourceTest : public ::testing::Test {
protected:
- virtual void SetUp() {
+ void SetUp() override {
ASSERT_EQ(0, getrlimit(RLIMIT_CORE, &l32_));
ASSERT_EQ(0, getrlimit64(RLIMIT_CORE, &l64_));
ASSERT_EQ(0, prlimit(0, RLIMIT_CORE, nullptr, &pr_l32_));
diff --git a/tools/versioner/src/Driver.cpp b/tools/versioner/src/Driver.cpp
index 6062240..3927480 100644
--- a/tools/versioner/src/Driver.cpp
+++ b/tools/versioner/src/Driver.cpp
@@ -62,7 +62,7 @@
: header_database(header_database), type(type) {
}
- virtual void HandleTranslationUnit(ASTContext& ctx) override {
+ void HandleTranslationUnit(ASTContext& ctx) override {
header_database->parseAST(type, ctx);
}
};