[libcxx-commits] [libcxx] d2f21f9 - Conversion from '__int64' to 'long', possible loss of data

Mark de Wever via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 17 07:43:48 PDT 2022


Author: Igor Zhukov
Date: 2022-07-17T16:43:41+02:00
New Revision: d2f21f98a95530f0e904a18507c5805d59658635

URL: https://github.com/llvm/llvm-project/commit/d2f21f98a95530f0e904a18507c5805d59658635
DIFF: https://github.com/llvm/llvm-project/commit/d2f21f98a95530f0e904a18507c5805d59658635.diff

LOG: Conversion from '__int64' to 'long', possible loss of data

llvm-project\libcxx\test\std\time\time.hms\time.hms.members\seconds.pass.cpp(38): note: see reference to function template instantiation 'long check_seconds<std::chrono::seconds>(Duration)' being compiled
        with
        [
            Duration=std::chrono::seconds
        ]
llvm-project\libcxx\test\std\time\time.hms\time.hms.members\seconds.pass.cpp(31): warning C4244: 'return': conversion from '_Rep' to 'long', possible loss of data
        with
        [
            _Rep=__int64
        ]

Reviewed By: #libc, Mordante

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

Added: 
    

Modified: 
    libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
    libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp b/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
index cfe2760b522ac..7aa9f3c4a1035 100644
--- a/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
+++ b/libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
@@ -17,13 +17,14 @@
 
 #include <chrono>
 #include <cassert>
+#include <cstdint>
 #include <ratio>
 #include <utility>
 
 #include "test_macros.h"
 
 template <typename Duration>
-constexpr long check_seconds(Duration d)
+constexpr int64_t check_seconds(Duration d)
 {
     using HMS = std::chrono::hh_mm_ss<Duration>;
     ASSERT_SAME_TYPE(std::chrono::seconds, decltype(std::declval<HMS>().seconds()));

diff  --git a/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp b/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
index a0b418a17a8ff..b3b46a974d4b3 100644
--- a/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
+++ b/libcxx/test/std/time/time.hms/time.hms.members/subseconds.pass.cpp
@@ -17,13 +17,14 @@
 
 #include <chrono>
 #include <cassert>
+#include <cstdint>
 #include <ratio>
 #include <utility>
 
 #include "test_macros.h"
 
 template <typename Duration>
-constexpr long check_subseconds(Duration d)
+constexpr int64_t check_subseconds(Duration d)
 {
     using HMS = std::chrono::hh_mm_ss<Duration>;
     ASSERT_SAME_TYPE(typename HMS::precision, decltype(std::declval<HMS>().subseconds()));


        


More information about the libcxx-commits mailing list