The macro was not defined in C++11 mode when it should have been, at least
according to how _LIBCPP_HAS_C11_FEATURES is defined.
Details
- Reviewers
mclow.lists EricWF jfb dexonsmith - Commits
- rGff0e60f32380: Merging r339702: --------------------------------------------------------------…
rG6513f375b18d: [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
rL339988: Merging r339702:
rL339702: [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
rCXX339702: [libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
Diff Detail
- Repository
- rCXX libc++
Event Timeline
The goal of this commit is to fix build bot failures here: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/builds/286/steps/test.libcxx/logs/stdio. This failure was introduced when I fixed some unit tests that were no-ops in https://reviews.llvm.org/D50674 -- I didn't test that change on Linux so I didn't catch the failure before the bots notified me.
To test this change, I bootstrapped a Docker image with a configuration similar to the build bot, and was able to reproduce the issue. Applying this patch fixed the issue.
Side note: we should probably strive to have docker containers for as many libc++ build bots as possible -- this makes it possible to reproduce failures locally, which is otherwise a guessing game. Even better -- we could run better tests before submitting a change and avoid breaking the build altogether!
From __ISO_C_VISIBLE >= 2011 it looks like this tries to test C11 features regardless of the C++ version. That's probably fine, but we're walking this line where only C++17 really guarantees C11 support, so this entire thing is weird and brittle to me. You're not changing the brittle-ness, just removing one kink, so from that perspective this change LGTM.
libcxx/test/support/test_macros.h | ||
---|---|---|
127 ↗ | (On Diff #160616) | Should this be TEST_STD_VER >= 11? |
I have pissed in this area, too - See https://bugs.llvm.org/show_bug.cgi?id=38495 and the proposed resolution here: https://bugs.llvm.org/attachment.cgi?id=20692
How about I just make this change as part of that fix?
If the bots are red from a previous commit I think it would be better for Louis to commit this separately.
Ok, I'm pushing with JF's suggested change (use TEST_STD_VER >= 11 instead of __cplusplus >= 201103L). Let's cross fingers that this is going to unbreak the testers -- like I said it fixed my Docker container.
thinking about this more, I think this the wrong long-term direction.
The presence/absence of C11 features in the underlying C library does not depend on what version of the C++ language we're compiling with.
The tests that use TEXT_HAS_C11_XXX should be updated to check TEST_STD_VER instead.
However, I'm fine with this as a short-term fix.