[PATCH] D115163: Fix compilation of Google Test in C++20 mode

Benjamin Kramer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 6 09:08:07 PST 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGc94eb0f9ef55: Fix compilation of Google Test in C++20 mode (authored by Godin, committed by bkramer).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115163/new/

https://reviews.llvm.org/D115163

Files:
  llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h


Index: llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
===================================================================
--- llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
+++ llvm/utils/unittest/googlemock/include/gmock/gmock-actions.h
@@ -825,7 +825,8 @@
   Class* const obj_ptr;
   const MethodPtr method_ptr;
 
-  using ReturnType = typename std::result_of<MethodPtr(Class*)>::type;
+  using ReturnType =
+      decltype((std::declval<Class*>()->*std::declval<MethodPtr>())());
 
   template <typename... Args>
   ReturnType operator()(const Args&...) const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115163.392096.patch
Type: text/x-patch
Size: 593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211206/0bbc5646/attachment.bin>


More information about the llvm-commits mailing list