Partial revert of "Use std::foo_t rather than std::foo in LLVM." in googlebench
authorJon Roelofs <jonathan_roelofs@apple.com>
Thu, 29 Apr 2021 22:36:24 +0000 (15:36 -0700)
committerJon Roelofs <jonathan_roelofs@apple.com>
Mon, 3 May 2021 14:49:30 +0000 (07:49 -0700)
Since googlebench builds as c++11, the change there is incorrect and breaks the
googlebench build when the STL implementation is strict about std::enable_if_t
not being available in lesser c++ versions.

partial revert of: 1bd6123b781120c9190b9ba58b900cdcb718cdd1 (https://reviews.llvm.org/D74384)

Differential Revision: https://reviews.llvm.org/D101583

llvm/utils/benchmark/src/sysinfo.cc

index 04254bb..01dd8a0 100644 (file)
@@ -176,8 +176,9 @@ bool GetSysctl(std::string const& Name, std::string* Out) {
   return true;
 }
 
-template <class Tp, class = std::enable_if_t<std::is_integral<Tp>::value>>
-bool GetSysctl(std::string const &Name, Tp *Out) {
+template <class Tp,
+          class = typename std::enable_if<std::is_integral<Tp>::value>::type>
+bool GetSysctl(std::string const& Name, Tp* Out) {
   *Out = 0;
   auto Buff = GetSysctlImp(Name);
   if (!Buff) return false;