[libcxx-commits] [PATCH] D114242: [libc++] Fix some tests that were broken in the single-threaded configuration

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 19 07:54:58 PST 2021


ldionne marked an inline comment as done.
ldionne added a comment.

In D114242#3142796 <https://reviews.llvm.org/D114242#3142796>, @Mordante wrote:

> Fair point. At some point it would be nice to have an actual "freestanding" C library for these test purposes. But I agree it would be a waste of our time to try to create that. (Unless we have somebody with too much time on their hands ;-) )

Well, I wouldn't say it would be a waste of time -- I think it would be super useful and in fact it could help formalize what it means to support various levels of Freestanding, even for other C++ Standard Library implementations. However, yeah, it's not the highest on the priority list.



================
Comment at: libcxx/utils/generate_feature_test_macro_components.py:657
+# For example, when threads are not supported, any test that includes
+# <thread> should be marked as UNSUPPORTED, because including <thread>
+# is a hard error in that case.
----------------
jloser wrote:
> I find it interesting that including `<thread>` would be a hard error rather than a no-op like other "unsupported features" when it comes to including other headers (like ranges, concepts, etc.). No action required, but just an observation.
We do have some inconsistency around that, however all features like "no-localization", "no-wide-characters", "no-random-device" are hard errors, and I think it makes the most sense. Indeed, what we're trying to model here is a platform that literally does not support these features. For example, on some platforms, you literally can't include `<wchar.h>`, because there is no such header. Putting an `#error` on our side is what models that best IMO.

Features like concepts are somewhat different, in that it's a matter of compiler support, where we try to be flexible and accommodate compilers that have incomplete support for X.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D114242/new/

https://reviews.llvm.org/D114242



More information about the libcxx-commits mailing list