This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Avoid potential truncation warnings in std::abs test
ClosedPublic

Authored by ldionne on Nov 19 2021, 7:00 AM.

Details

Summary

One some platforms, -Wimplicit-int-conversion is enabled by default,
which can lead to additional warnings being triggered in this test.
Since we're only trying to test errors related to calling abs(), the
assignment is superfluous.

As a fly-by fix, correct one instance of ::abs to std::abs.

Diff Detail

Event Timeline

ldionne requested review of this revision.Nov 19 2021, 7:00 AM
ldionne created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 19 2021, 7:00 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Mordante accepted this revision as: Mordante.Nov 19 2021, 7:12 AM
Mordante added a subscriber: Mordante.

LGTM. Interesting to see different diagnostics.

jloser added a subscriber: jloser.EditedNov 19 2021, 7:34 AM

LGTM. You should be able to remove #include "test_macros.h" if you feel like it.

ldionne accepted this revision as: Restricted Project.Nov 19 2021, 11:20 AM

LGTM. You should be able to remove #include "test_macros.h" if you feel like it.

Removed upon committing.

This revision is now accepted and ready to land.Nov 19 2021, 11:20 AM