This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Correct asserted type in subspan test; subspan with count should never produce dynamic_extent
ClosedPublic

Authored by BillyONeal on Jan 21 2020, 1:32 PM.

Details

Summary

I'm not sure if this was a change in the standard behavior or if it was a typo in libcxx from the beginning. http://eel.is/c++draft/span.sub#10 says that if a count is supplied, the returned span is always of that count, never of dynamic_extent, so these tests were asserting incorrectly.

I'm not sure what to do about this as fixing the test to assert correctly (and thus make msvc++ pass) is going to make libcxx fail.

Diff Detail

Event Timeline

BillyONeal created this revision.Jan 21 2020, 1:32 PM

@ldionne I think you're correct, though the test there is more complex than it needs to be (because the ==Count cases are the only ever encountered here).

ldionne accepted this revision.Feb 18 2020, 12:05 PM

@ldionne I think you're correct, though the test there is more complex than it needs to be (because the ==Count cases are the only ever encountered here).

Hmm, yes, you're right! I'll take your patch on top. Thanks!

This revision is now accepted and ready to land.Feb 18 2020, 12:05 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 18 2020, 12:08 PM
miscco added a subscriber: miscco.Feb 19 2020, 12:25 AM

Ah sorry about that, I overlooked that we had special cased tests without count.

Thanks Billy