This is an archive of the discontinued LLVM Phabricator instance.

Conversion from '__int64' to 'long', possible loss of data
ClosedPublic

Authored by fsb4000 on Jul 16 2022, 3:05 AM.

Details

Reviewers
Mordante
Group Reviewers
Restricted Project
Commits
rGd2f21f98a955: Conversion from '__int64' to 'long', possible loss of data
Summary

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
]

Diff Detail

Event Timeline

fsb4000 created this revision.Jul 16 2022, 3:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2022, 3:05 AM
fsb4000 requested review of this revision.Jul 16 2022, 3:05 AM
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 16 2022, 3:05 AM
Mordante accepted this revision.Jul 16 2022, 10:23 AM
Mordante added a subscriber: Mordante.

Thanks for making the test compatible with MSVC STL. LGTM, one question.

libcxx/test/std/time/time.hms/time.hms.members/seconds.pass.cpp
26

How do you feel about using int64_t instead?

This revision is now accepted and ready to land.Jul 16 2022, 10:23 AM
fsb4000 added a comment.EditedJul 16 2022, 10:23 AM

Sure, int64_t is fine too.
I will create diff now.

fsb4000 updated this revision to Diff 445237.Jul 16 2022, 10:31 AM

use int64_t instead of long long

Thanks, I'll land it on your behalf when the CI is green.

This revision was automatically updated to reflect the committed changes.

I've landed this one too, so now all 3 of your test fixes for MSVC STL have landed.
Thanks for the improvements!

Thank you too!