[benchmark] Back port 2b0bff7 from upstream (#212278)
Fix compile error with clang -Werror -Wunused-template (cherry picked from commit 2b0bff7444a8df460daab2e5af18bce45ca00657)
This commit is contained in:
parent
dc5f2aae75
commit
13a6fc28ac
1 changed files with 3 additions and 2 deletions
5
third-party/benchmark/src/sysinfo.cc
vendored
5
third-party/benchmark/src/sysinfo.cc
vendored
|
|
@ -143,7 +143,7 @@ struct ValueUnion {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T, int N>
|
template <class T, int N>
|
||||||
std::array<T, N> GetAsArray() {
|
BENCHMARK_MAYBE_UNUSED std::array<T, N> GetAsArray() {
|
||||||
const int arr_size = sizeof(T) * N;
|
const int arr_size = sizeof(T) * N;
|
||||||
BM_CHECK_LE(arr_size, size);
|
BM_CHECK_LE(arr_size, size);
|
||||||
std::array<T, N> arr;
|
std::array<T, N> arr;
|
||||||
|
|
@ -204,7 +204,8 @@ bool GetSysctl(std::string const& name, Tp* out) {
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Tp, size_t N>
|
template <class Tp, size_t N>
|
||||||
bool GetSysctl(std::string const& name, std::array<Tp, N>* out) {
|
BENCHMARK_MAYBE_UNUSED bool GetSysctl(std::string const& name,
|
||||||
|
std::array<Tp, N>* out) {
|
||||||
auto buff = GetSysctlImp(name);
|
auto buff = GetSysctlImp(name);
|
||||||
if (!buff) return false;
|
if (!buff) return false;
|
||||||
*out = buff.GetAsArray<Tp, N>();
|
*out = buff.GetAsArray<Tp, N>();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue