clang doesn't provide the atomic intrinsics in C++03 and lower so even including atomic leads to a compile error. This header is strictly not supported in c++03.
Details
Diff Detail
Event Timeline
Actually, on second thought, shouldn't these be XFAIL? Do we care about ensuring that you can't use <atomic> for < C++11?
Are you saying that if we plan to support <atomic> in C++03 we should mark them as XFAIL? I don't think <atomic> will ever be supported below c++11, hence the use of <atomic> in c++03 is "unsupported".
Let me know if I didn't understand anything.
I'm saying we might want to verify that these do in fact fail. UNSUPPORTED
causes the test to not be run, XFAIL tests to ensure failure, which is
possibly what we want here. OTOH, our test configuration isn't set up to do
conditional _compile time_ failures, so maybe we should just settle for
UNSUPPORTED.
I'm saying we might want to verify that these do in fact fail. UNSUPPORTED
causes the test to not be run, XFAIL tests to ensure failure, which is
possibly what we want here.
OTOH, our test configuration isn't set up to do
conditional _compile time_ failures, so maybe we should just settle for UNSUPPORTED.
Your right. That's probably a good idea. <atomic> is unique in that it actually explicitly errors when it is included but won't work.
.fail.cpp tests are expected to fail at compile time. I think we should do is leave these tests as unsupported and add a cxx03.fail.cpp test
that ensures including <atomic> results in a compiler failures.
Here's my gripe. I like the separation between
- XFAIL - tests that should be fixed.
- UNSUPPORTED - tests I don't care about at all.
It makes it a lot easier to watch just the tests I care about. Adding one XFAIL test seems a touch cleaner, and will guarantee the same thing.
Added two tests to ensure that <atomic> doesn't compile when one of the following is true:
- __cplusplus < 201103L
- _LIBCPP_HAS_NO_THREADS is defined.
The added tests are:
- /test/atomics/c++11-only.fail.cpp
- /test/atomics/libcpp-no-threads.fail.cpp
It seems like it might be possible to get these tests working in C++03 mode under clang. Abandoning this so we can try and get them working instead.
test/atomics/libcpp-no-threads.fail.cpp | ||
---|---|---|
1 | test/atomics/libcpp-no-threads.fail.cpp looks useful to me as a separate change, though we probably ought to think about how to support fail tests that are conditional on platform specifics (which is what this test really ought to be). I think the way forward on that would be to add support for support for implicit "XFAIL: *" in *.fail.cpp tests when an XFAIL line isn't specified. Then the afformentioned test should have an "XFAIL: libcpp-has-no-threads". Something to discus at the cross testing BOF, I suppose.... |
test/atomics/libcpp-no-threads.fail.cpp looks useful to me as a separate change, though we probably ought to think about how to support fail tests that are conditional on platform specifics (which is what this test really ought to be).
I think the way forward on that would be to add support for support for implicit "XFAIL: *" in *.fail.cpp tests when an XFAIL line isn't specified. Then the afformentioned test should have an "XFAIL: libcpp-has-no-threads".
Something to discus at the cross testing BOF, I suppose....