This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Implement LWG3369, tweak CTAD for std::span.
ClosedPublic

Authored by Quuxplusone on Oct 14 2021, 2:05 PM.

Details

Summary

The original bug doesn't reproduce on Clang, allegedly because of
https://bugs.llvm.org/show_bug.cgi?id=44484
We already test STL's exact test case, in span.cons/deduct.pass.cpp, which I'm touching just for the heck of it.

Diff Detail

Event Timeline

Quuxplusone requested review of this revision.Oct 14 2021, 2:05 PM
Quuxplusone created this revision.
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptOct 14 2021, 2:05 PM
jloser accepted this revision.Oct 14 2021, 5:29 PM

LGTM - thanks for looking into it.

libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
9

We could do a similar thing for all the files I touched in my recent span PR FYI. We're going to drop support for AppleClang 12.0.0 officially in BuildKite hopefully soon since we only need to support AppleClang 13.0.0 technically. At that point, all the UNSUPPORTED: libcpp-no-concepts go away.

Can you add a test for the fix. For example STL's example in LWG3369? Or does the Clang bug prevent us from testing it?

libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
56–58

@Mordante: I believe this is the exact test case displayed in https://cplusplus.github.io/LWG/issue3369 — and yeah, I assume it passes anyway because of that Clang bug. I don't have the capability to test libc++ with non-Clang compilers to see if it fails... although I confess I don't understand why this test passes even with the gcc buildkite.

Mordante accepted this revision as: Mordante.Oct 17 2021, 4:23 AM

LGTM!

libcxx/test/std/containers/views/span.cons/deduct.pass.cpp
56–58

That's indeed the same test.

ldionne accepted this revision.Oct 28 2021, 1:37 PM

I guess that means we are forward-compatible with Clang once they fix PR44484. Let's ship this.

This revision is now accepted and ready to land.Oct 28 2021, 1:37 PM