diff options
author | 2023-02-27 11:56:55 +0000 | |
---|---|---|
committer | 2023-02-28 14:58:45 +0000 | |
commit | 7b5829d07f862c59cc9a4c2d35791c76ac1cdeed (patch) | |
tree | d5350c58c1a660fb4383c938f31fb9f7212e5361 | |
parent | 614357ba76aa4b9b930a083cd4d5b95fad0c5db8 (diff) |
Replace uses of annotation `[[gnu::unused]]` with `[[maybe_unused]]`.
The former is a GCC/Clang extension, while the latter is part of the
C++17 standard.
Test: mmm art
Bug: 169680875
Change-Id: Ia3370cee7f15a6a42662540fe61ab5efcf2941ff
-rw-r--r-- | libartbase/base/metrics/metrics_test.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libartbase/base/metrics/metrics_test.cc b/libartbase/base/metrics/metrics_test.cc index 324d83d8ac..a5ad4ece99 100644 --- a/libartbase/base/metrics/metrics_test.cc +++ b/libartbase/base/metrics/metrics_test.cc @@ -272,13 +272,13 @@ TEST_F(MetricsTest, ResetMetrics) { class NonZeroBackend : public TestBackendBase { public: - void ReportCounter(DatumId counter_type [[gnu::unused]], uint64_t value) override { + void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override { EXPECT_NE(value, 0u); } - void ReportHistogram(DatumId histogram_type [[gnu::unused]], - int64_t minimum_value [[gnu::unused]], - int64_t maximum_value [[gnu::unused]], + void ReportHistogram(DatumId histogram_type [[maybe_unused]], + int64_t minimum_value [[maybe_unused]], + int64_t maximum_value [[maybe_unused]], const std::vector<uint32_t>& buckets) override { bool nonzero = false; for (const auto value : buckets) { @@ -296,13 +296,13 @@ TEST_F(MetricsTest, ResetMetrics) { class ZeroBackend : public TestBackendBase { public: - void ReportCounter(DatumId counter_type [[gnu::unused]], uint64_t value) override { + void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override { EXPECT_EQ(value, 0u); } - void ReportHistogram(DatumId histogram_type [[gnu::unused]], - int64_t minimum_value [[gnu::unused]], - int64_t maximum_value [[gnu::unused]], + void ReportHistogram(DatumId histogram_type [[maybe_unused]], + int64_t minimum_value [[maybe_unused]], + int64_t maximum_value [[maybe_unused]], const std::vector<uint32_t>& buckets) override { for (const auto value : buckets) { EXPECT_EQ(value, 0u); @@ -323,13 +323,13 @@ TEST_F(MetricsTest, KeepEventMetricsResetValueMetricsAfterReporting) { class FirstBackend : public TestBackendBase { public: - void ReportCounter(DatumId counter_type [[gnu::unused]], uint64_t value) override { + void ReportCounter(DatumId counter_type [[maybe_unused]], uint64_t value) override { EXPECT_NE(value, 0u); } - void ReportHistogram(DatumId histogram_type [[gnu::unused]], - int64_t minimum_value [[gnu::unused]], - int64_t maximum_value [[gnu::unused]], + void ReportHistogram(DatumId histogram_type [[maybe_unused]], + int64_t minimum_value [[maybe_unused]], + int64_t maximum_value [[maybe_unused]], const std::vector<uint32_t>& buckets) override { bool nonzero = false; for (const auto value : buckets) { @@ -369,9 +369,9 @@ TEST_F(MetricsTest, KeepEventMetricsResetValueMetricsAfterReporting) { } // All histograms are event metrics. - void ReportHistogram(DatumId histogram_type [[gnu::unused]], - int64_t minimum_value [[gnu::unused]], - int64_t maximum_value [[gnu::unused]], + void ReportHistogram(DatumId histogram_type [[maybe_unused]], + int64_t minimum_value [[maybe_unused]], + int64_t maximum_value [[maybe_unused]], const std::vector<uint32_t>& buckets) override { bool nonzero = false; for (const auto value : buckets) { |