This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Remove unused variable
ClosedPublic

Authored by ldionne on Jun 2 2021, 9:14 AM.

Details

Reviewers
Quuxplusone
Group Reviewers
Restricted Project
Commits
rG2cf78d4ead4a: [libc++] Remove unused variable warnings
Summary

Since D100581, Clang started flagging this variable which is set but
never read. Based on comparing this function with __match_at_start_posix_nosubs
(which is very similar), I am pretty confident that __j was simply left
behind as an oversight in Howard's 6afe8b0a2336.

Diff Detail

Event Timeline

ldionne created this revision.Jun 2 2021, 9:14 AM
ldionne requested review of this revision.Jun 2 2021, 9:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2021, 9:14 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne updated this revision to Diff 349304.Jun 2 2021, 9:39 AM

Remove the warning in the test suite too.

ldionne updated this revision to Diff 349314.Jun 2 2021, 10:15 AM
ldionne retitled this revision from [libc++] Add workaround for false positive introduced by D100581 to [libc++] Remove unused variable.
ldionne edited the summary of this revision. (Show Details)

Remove j instead of silencing the error -- after some research, I think j was left behind as an oversight.

Quuxplusone accepted this revision.Jun 2 2021, 10:42 AM
Quuxplusone added a subscriber: Quuxplusone.

If buildkite's happy, I'm happy!

This revision is now accepted and ready to land.Jun 2 2021, 10:42 AM
bjope added a subscriber: bjope.Jun 2 2021, 12:42 PM
ldionne updated this revision to Diff 349363.Jun 2 2021, 1:30 PM

Fix issues in <random> tests

Quuxplusone added inline comments.Jun 2 2021, 1:35 PM
libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
185–186

Well, that's not going to work. ;)

203–207

Shouldn't you just comment these lines back in, so that the variables end up getting used/tested?
Line 197's comment is relevant, though.

ldionne updated this revision to Diff 349402.Jun 2 2021, 3:36 PM

Hopefully fix remaining issues.

ldionne marked an inline comment as done.Jun 2 2021, 3:36 PM
ldionne added inline comments.
libcxx/test/std/numerics/rand/rand.dis/rand.dist.bern/rand.dist.bern.bin/eval.pass.cpp
203–207

I tested with ubsan enabled and I'm not seeing any issue.

This revision was automatically updated to reflect the committed changes.
ldionne marked an inline comment as done.