[PATCH] D105595: [flang] Compile error instantiating std::clock_t on Apple clang version 11.0.0

Craig E Rasmussen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 21 11:09:01 PDT 2021


craig.rasmussen updated this revision to Diff 360531.
craig.rasmussen added a comment.

Made simplification suggested by reviewer:

std::clock_t{static_cast<clock_t>(-1)}  -->  static_cast<clock_t>(-1)


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

https://reviews.llvm.org/D105595

Files:
  flang/runtime/time-intrinsic.cpp


Index: flang/runtime/time-intrinsic.cpp
===================================================================
--- flang/runtime/time-intrinsic.cpp
+++ flang/runtime/time-intrinsic.cpp
@@ -36,7 +36,7 @@
 // This is the fallback implementation, which should work everywhere.
 template <typename Unused = void> double getCpuTime(fallback_implementation) {
   std::clock_t timestamp{std::clock()};
-  if (timestamp != std::clock_t{-1}) {
+  if (timestamp != static_cast<clock_t>(-1)) {
     return static_cast<double>(timestamp) / CLOCKS_PER_SEC;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105595.360531.patch
Type: text/x-patch
Size: 548 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210721/929b4756/attachment.bin>


More information about the llvm-commits mailing list