[libcxx-commits] [PATCH] D142285: [libc++] Don't include <version> everywhere

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 22 05:27:45 PST 2023


Mordante added a subscriber: EricWF.
Mordante added a comment.

Can you please explain why this is done? What are the benefits for users/libc++ itself?

I'm not convinced this is an improvement:

- most (all) toplevel headers have a generated part, which to me looks like a potential source of bugs.
- this may give different behaviour for users who use FTM, but not include the proper header. (Obviously that is a bug in their code, but currently it works, after this change is may break of change the behaviour.)
- since we don't want to break older language versions we now duplicate the macros.

This change should definitely be mentioned in the Release Notes.

This source for https://libcxx.llvm.org/DesignDocs/FeatureTestMacros.html should be updated too.

@EricWF can you tell why the original script took the approach to have one version header?



================
Comment at: libcxx/include/__format/format_functions.h:14
-// TODO FMT This is added to fix Apple back-deployment.
-#include <version>
 #if !defined(_LIBCPP_HAS_NO_INCOMPLETE_FORMAT)
----------------
This will break compilation.


================
Comment at: libcxx/utils/generate_feature_test_macro_components.py:572
     "values": { "c++2b": 202202 },
-    "headers": ["deque", "forward_list", "list", "map", "priority_queue", "queue", "set", "stack", "string", "unordered_map", "unordered_set", "vector"],
     "unimplemented": True,
----------------
Can you add the `__cpp_lib_containers_ranges` macro?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142285



More information about the libcxx-commits mailing list