[PATCH] D101583: Partial revert of "Use std::foo_t rather than std::foo in LLVM." in googlebench

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 29 15:46:14 PDT 2021


jroelofs created this revision.
jroelofs added reviewers: jlebar, MaskRay, bkramer.
Herald added a reviewer: lebedev.ri.
Herald added a subscriber: lebedev.ri.
jroelofs requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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/rG1bd6123b781120c9190b9ba58b900cdcb718cdd1> (https://reviews.llvm.org/D74384)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101583

Files:
  llvm/utils/benchmark/src/sysinfo.cc


Index: llvm/utils/benchmark/src/sysinfo.cc
===================================================================
--- llvm/utils/benchmark/src/sysinfo.cc
+++ llvm/utils/benchmark/src/sysinfo.cc
@@ -176,8 +176,9 @@
   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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101583.341684.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210429/ff259746/attachment.bin>


More information about the llvm-commits mailing list