Page MenuHomePhabricator
Feed Advanced Search

Today

philnik committed rG1a17739d3aa7: [libc++] Avoid ODR violations in __exception_guard (authored by philnik).
[libc++] Avoid ODR violations in __exception_guard
Wed, Feb 1, 5:07 PM · Restricted Project, Restricted Project
philnik closed D143071: [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 5:07 PM · Restricted Project, Restricted Project
philnik updated the diff for D139554: [libc++] Forward to std::memcmp for trivially comparable types in equal.

Try to fix CI

Wed, Feb 1, 4:08 PM · Restricted Project, Restricted Project
philnik updated the diff for D143071: [libc++] Avoid ODR violations in __exception_guard.

Next try

Wed, Feb 1, 3:38 PM · Restricted Project, Restricted Project
philnik updated the diff for D142180: [libc++] Enforce formatting for already formatted and new files and ignore the formatting of tests.

Address comments

Wed, Feb 1, 3:24 PM · Restricted Project, Restricted Project
philnik updated the diff for D143071: [libc++] Avoid ODR violations in __exception_guard.

Next try

Wed, Feb 1, 2:05 PM · Restricted Project, Restricted Project
philnik committed rG42701cac8128: [libc++] Look for Clang 17 when compiling clang-tidy checks (authored by philnik).
[libc++] Look for Clang 17 when compiling clang-tidy checks
Wed, Feb 1, 2:05 PM · Restricted Project, Restricted Project
philnik closed D142973: [libc++] Look for Clang 17 when compiling clang-tidy checks.
Wed, Feb 1, 2:05 PM · Restricted Project, Restricted Project
philnik added a comment to D143033: [libc++] Disable some tests in `math_nodiscard_extensions`..

No, this also applies to the non-__builtin_ versions. The math functions are declared at about line 1200 (currently).

Thanks. It means it applies to our definition of double fabs(double), right? (If that's the case, it doesn't need the nodiscard attribute on Clang, though I guess it's there for the sake of GCC)

No. Clang only adds them to overloads with C linkage (https://godbolt.org/z/rjY3xeo3o). GCC also warns with -Wall. I don't know where to see that though. So I guess hypothetically there could be a C library that doesn't have these functions declared extern "C" but I doubt these actually exist.

The [[nodiscard]] declarations are specifically there to match the diagnostics produced by the compiler, so I think we should check that the compiler actually produces the same diagnostic for all overloads. (https://godbolt.org/z/87hMPjeq7)

In the Godbolt link, the non-double overloads of trunc test our implementation, while trunc(0.) essentially tests that Clang adds the const attribute. I don't think we should be testing Clang behavior.

I guess we just disagree here. IMO we should test the Clang implementation if we mirror it, especially if it's pretty much trivial to check.

Moreover, this seems Clang-centric. Does GCC have the same behavior? If not, a platform that compiles with GCC and "overrides" one of the math functions will fail the expectation (though to be fair, we could mark the test as unsupported on GCC).

We can mark it as unsuported on GCC, although it seems kind-of pointless, since GCC will most likely never implement -verify and definitely won't mirror clang warning wording.

To be clear, I think the idea of adding the attributes is sound. However, testing it is hard, for reasons outside of our control.

Wed, Feb 1, 12:17 PM · Restricted Project, Restricted Project
philnik committed rGdc017e03ca55: [libc++] Forward ranges::sort to instantiations in the dylib (authored by philnik).
[libc++] Forward ranges::sort to instantiations in the dylib
Wed, Feb 1, 11:10 AM · Restricted Project, Restricted Project
philnik closed D140824: [libc++] Forward ranges::sort to instantiations in the dylib.
Wed, Feb 1, 11:10 AM · Restricted Project, Restricted Project
philnik committed rGc15ba1bb9498: [libc++] Split ranges.transform.binary.pass.cpp up (authored by philnik).
[libc++] Split ranges.transform.binary.pass.cpp up
Wed, Feb 1, 10:56 AM · Restricted Project, Restricted Project
philnik closed D142183: [libc++] Split ranges.transform.binary.pass.cpp up.
Wed, Feb 1, 10:56 AM · Restricted Project, Restricted Project
philnik committed rG97b5e0147c6f: [libc++] Remove explicit instantiations of __insertion_sort_incomplete and… (authored by philnik).
[libc++] Remove explicit instantiations of __insertion_sort_incomplete and…
Wed, Feb 1, 10:54 AM · Restricted Project, Restricted Project
philnik closed D142185: [libc++] Remove explicit instantiations of __insertion_sort_incomplete and __sort5 from the dylib.
Wed, Feb 1, 10:53 AM · Restricted Project, Restricted Project
philnik updated the diff for D143071: [libc++] Avoid ODR violations in __exception_guard.

Try to fix CI

Wed, Feb 1, 10:50 AM · Restricted Project, Restricted Project
philnik retitled D143071: [libc++] Avoid ODR violations in __exception_guard from [libc++] Add abi_tag on __exception_guard to avoid ODR violations to [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 10:19 AM · Restricted Project, Restricted Project
philnik added inline comments to D143071: [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 10:17 AM · Restricted Project, Restricted Project
philnik committed rGc8eff9560fc1: [libc++] Add a clang-tidy check to make sure we use _Uglyfied attribute names (authored by philnik).
[libc++] Add a clang-tidy check to make sure we use _Uglyfied attribute names
Wed, Feb 1, 9:57 AM · Restricted Project, Restricted Project
philnik closed D142322: [libc++] Add a clang-tidy check to make sure we use _Uglyfied attribute names.
Wed, Feb 1, 9:57 AM · Restricted Project, Restricted Project
philnik updated the diff for D142973: [libc++] Look for Clang 17 when compiling clang-tidy checks.

Address comments

Wed, Feb 1, 9:53 AM · Restricted Project, Restricted Project
philnik updated the diff for D143071: [libc++] Avoid ODR violations in __exception_guard.

Address comments

Wed, Feb 1, 9:52 AM · Restricted Project, Restricted Project
philnik updated the summary of D143071: [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 7:59 AM · Restricted Project, Restricted Project
philnik updated the diff for D143071: [libc++] Avoid ODR violations in __exception_guard.

Try to fix CI

Wed, Feb 1, 7:59 AM · Restricted Project, Restricted Project
philnik added inline comments to D143071: [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 7:54 AM · Restricted Project, Restricted Project
philnik added a comment to D133661: [libc++] Improve binary size when using __transaction.

I've uploaded D143071 to fix the problem. I talk to Louis later today, so a fix should be commited within the next 6 hours or so.

Wed, Feb 1, 7:24 AM · Restricted Project, Restricted Project
philnik requested review of D143071: [libc++] Avoid ODR violations in __exception_guard.
Wed, Feb 1, 7:22 AM · Restricted Project, Restricted Project
philnik added a comment to D133661: [libc++] Improve binary size when using __transaction.

@philnik could you commit one of the proposed abi_tag fixes?

Actually, I went ahead and committed it as 561105fb9d3a16f7fb8c718cc5da71b11f17a144 to unblock us. Hopefully, that's small and obvious enough to not violate the code review policies.

libc++ has a pretty good precommit test infra that gets triggered when a review is created, so in the future it would be better to create a review and wait for CI before landing w/o review.

Although gnu::abi_tag was suggested, I took that to mean __attribute__((__abi_tag__(...))) when I tested the suggestion locally, as elsewhere libc++ uses ABI tags like so:

#    define _LIBCPP_HIDE_FROM_ABI                                                                                      \
      _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION                                                       \
          __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_VERSIONED_IDENTIFIER))))
Wed, Feb 1, 7:06 AM · Restricted Project, Restricted Project
philnik added a reverting change for rG561105fb9d3a: [libc++] Fix ODR violation with __exception_guard in mixed exceptions builds: rG157c12310cbc: Revert "[libc++] Fix ODR violation with __exception_guard in mixed exceptions….
Wed, Feb 1, 7:06 AM · Restricted Project, Restricted Project
philnik committed rG157c12310cbc: Revert "[libc++] Fix ODR violation with __exception_guard in mixed exceptions… (authored by philnik).
Revert "[libc++] Fix ODR violation with __exception_guard in mixed exceptions…
Wed, Feb 1, 7:06 AM · Restricted Project, Restricted Project
philnik added a comment to D143033: [libc++] Disable some tests in `math_nodiscard_extensions`..

It's not exactly documentation, but you can look at clang/include/clang/Basic/Builtins.def to see what attributes are applied to builtins and what builtins there are.

Thanks. If I'm reading this correctly, though, this applies to __builtin_foo functions only, right?

No, this also applies to the non-__builtin_ versions. The math functions are declared at about line 1200 (currently).

Taking a step back, I also don't think we should be testing compiler behavior or relying on what is essentially an implementation detail of Clang and presumably GCC.

The [[nodiscard]] declarations are specifically there to match the diagnostics produced by the compiler, so I think we should check that the compiler actually produces the same diagnostic for all overloads. (https://godbolt.org/z/87hMPjeq7)

Wed, Feb 1, 1:42 AM · Restricted Project, Restricted Project

Yesterday

philnik added a comment to D143033: [libc++] Disable some tests in `math_nodiscard_extensions`..

These are marked [[gnu::const]] through clang though. That's why these are regex matchers, not simple text versions.

Can you elaborate on how exactly this works? (or perhaps it's documented somewhere)

Tue, Jan 31, 5:04 PM · Restricted Project, Restricted Project
philnik requested changes to D143033: [libc++] Disable some tests in `math_nodiscard_extensions`..

These are marked [[gnu::const]] through clang though. That's why these are regex matchers, not simple text versions.

Tue, Jan 31, 4:52 PM · Restricted Project, Restricted Project
philnik added a comment to D133661: [libc++] Improve binary size when using __transaction.

the definition of the __exception_guard class being different is somehow more problematic.

That's correct - Clang/LLVM debug info under LTO does require structures with linkage to have consistent size at least.
The sort of errors are:

fragment is larger than or outside of variable
  call void @llvm.dbg.declare(metadata ptr undef, metadata !4274, metadata !DIExpression(DW_OP_LLVM_fragment, 200, 56)), !dbg !4288
!4274 = !DILocalVariable(name: "__guard", scope: !4275, file: !2826, line: 550, type: !2906)

Because LLVM LTO is validating that the debug info describing a variable makes sense given the type - but the type is deduplicated based on the linkage name of the type - so some debug info was emitted in some +exceptions code that is larger than the type definition taken from some -exceptions code.

I think some possible fixes would include

  • make the structure the same size regardless of +/-exceptions
  • use a macro to choose between two differently-linkage-named types (yeah, this is still an ODR violaiton for the function definitions that use these different entities - but within the realms of things we do for +/-exception compatibility, and nothing validates that ODR function definitions are identical)

I'll see if I can repro this with godbolt, but I think this ^ should be enough to justify a timely revert and/or fix. This patch is broken for mixed exceptions LTO builds.

Please don't revert. Other patches depend on this and it should be a trivial fix. We can just add an ABI tag to the noexcept version of the class IIUC. Could you confirm that? If that is the case I can make a patch.

Not quite sure what you mean - got a rough example of what an ABI tag would look like in this case? (looking through the libc++ sources notihng immediately stands out) - an extra template parameter (I see "Abi" template parameters in some places, for instance) or some other technique?

Tue, Jan 31, 3:39 PM · Restricted Project, Restricted Project
philnik added a comment to D133661: [libc++] Improve binary size when using __transaction.

the definition of the __exception_guard class being different is somehow more problematic.

That's correct - Clang/LLVM debug info under LTO does require structures with linkage to have consistent size at least.
The sort of errors are:

fragment is larger than or outside of variable
  call void @llvm.dbg.declare(metadata ptr undef, metadata !4274, metadata !DIExpression(DW_OP_LLVM_fragment, 200, 56)), !dbg !4288
!4274 = !DILocalVariable(name: "__guard", scope: !4275, file: !2826, line: 550, type: !2906)

Because LLVM LTO is validating that the debug info describing a variable makes sense given the type - but the type is deduplicated based on the linkage name of the type - so some debug info was emitted in some +exceptions code that is larger than the type definition taken from some -exceptions code.

I think some possible fixes would include

  • make the structure the same size regardless of +/-exceptions
  • use a macro to choose between two differently-linkage-named types (yeah, this is still an ODR violaiton for the function definitions that use these different entities - but within the realms of things we do for +/-exception compatibility, and nothing validates that ODR function definitions are identical)

I'll see if I can repro this with godbolt, but I think this ^ should be enough to justify a timely revert and/or fix. This patch is broken for mixed exceptions LTO builds.

Tue, Jan 31, 3:04 PM · Restricted Project, Restricted Project
philnik accepted D142909: [libc++] Addresses LWG3755..
Tue, Jan 31, 10:34 AM · Restricted Project, Restricted Project
philnik added a comment to D133661: [libc++] Improve binary size when using __transaction.

We're seeing a lot of fallout from this patch and they all look related to the ODR violations that seem to be intentionally added here: both the patch description and the comment for the __exception_guard mention explicitly that combinations of code compiled with exceptions and without exceptions are common.

Am I missing something here?

Tue, Jan 31, 4:22 AM · Restricted Project, Restricted Project
philnik requested review of D142973: [libc++] Look for Clang 17 when compiling clang-tidy checks.
Tue, Jan 31, 4:05 AM · Restricted Project, Restricted Project
philnik added a comment to D135248: [libc++] implement move_iterator<T*> should be a random access iterator .

Please remove the format-only changes. This makes it incredibly hard to see what you actually changed.

Tue, Jan 31, 3:53 AM · Restricted Project, Restricted Project
philnik added inline comments to D142843: [libc++] Addresses LWG3358.
Tue, Jan 31, 1:32 AM · Restricted Project, Restricted Project
philnik added inline comments to D142909: [libc++] Addresses LWG3755..
Tue, Jan 31, 1:22 AM · Restricted Project, Restricted Project
philnik accepted D142912: [NFC][libc++] Addresses LWG3781..
Tue, Jan 31, 1:18 AM · Restricted Project, Restricted Project
philnik accepted D142951: [libc++][ranges] Fix incorrect integer typedef in `elements_view` test..
Tue, Jan 31, 1:13 AM · Restricted Project, Restricted Project

Mon, Jan 30

philnik added a comment to D142902: [libcxx][pmr] Make std::pmr::memory_resource ABI-compatible with GNU libstdc++ and Microsoft STL implementation..

Our implementation isn't ABI compatible with libstdc++ or the MSVL STL. Putting them in the same namespace just results in subtle bugs.

Is which sense?

  • If we are talking about the full C++ standard library implementation - of course, it's not, but some parts were intentionally done compatible. For example: exception_ptr, <get|set>_terminate and other basic stuff.
  • If we are talking about the full <memory_resource> implementation it also would not be fully ABI compatible. But probably it should not be.
  • If we are talking just about std::pmr::memory_resource (and <get|set>_terminate), I believe it should be ABI compatible. The virtual methods are listed in the same order in libcxx file as in GNU and LLVM. So, to the best of my knowledge (and also based on experiments) the compiler correctly calculates the offset of the virtual table itself and the offset of the called method. That allows to pass memory resource from one binary (or translation unit) and interpret it correctly in other translation unit.

I think get|set_default_resource are also possible to make ABI compatible. Memory allocation is pretty basic operation and (as far as I know) there were attempts (probably successful, but as far as I remember something was broken with Windows toolchain) to make new ABI compatible with GNU and MSVC STL as well (set_new_handler, etc.) The behavior we want here is having the opportunity to have one default resource being set and then use it application-wide (for example if libcxx is built in compat mode with GNU). The similar scenario works with <get|set_terminate.

Other classes from pmr can potentially bring problems. If that's the concern probably the solution might be to put some APIs to __1 namespace. And I am not sure if those are bugs or not because nobody guarantees that two different C++ standard library implementations would work in one application (or I misunderstood the context). It might result in submitted bugs in bug tracker, though :) But still libcxx makes some effort to be ABI compatible with GNU and Microsoft for basic APIs. To me this use-cases as important as other examples I've provided above.

Mon, Jan 30, 2:02 PM · Restricted Project, Restricted Project
philnik added inline comments to D142332: [libc++] Add hide_from_abi check for classes.
Mon, Jan 30, 10:56 AM · Restricted Project, Restricted Project
philnik committed rG934650b24fbf: [libc++] Add [[clang::lifetimebound]] to min/max algorithms (authored by philnik).
[libc++] Add [[clang::lifetimebound]] to min/max algorithms
Mon, Jan 30, 9:02 AM · Restricted Project, Restricted Project
philnik closed D142608: [libc++] Add [[clang::lifetimebound]] to min/max algorithms.
Mon, Jan 30, 9:01 AM · Restricted Project, Restricted Project
philnik requested changes to D142902: [libcxx][pmr] Make std::pmr::memory_resource ABI-compatible with GNU libstdc++ and Microsoft STL implementation..

Our implementation isn't ABI compatible with libstdc++ or the MSVL STL. Putting them in the same namespace just results in subtle bugs.

Mon, Jan 30, 8:36 AM · Restricted Project, Restricted Project
philnik requested changes to D142864: [libc++] `<algorithm>`: `ranges::minmax` should dereference iterators only once.
Mon, Jan 30, 1:14 AM · Restricted Project, Restricted Project

Sun, Jan 29

philnik updated the summary of D142842: [libc++] Remove _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION.
Sun, Jan 29, 7:17 AM · Restricted Project, Restricted Project
philnik requested review of D142842: [libc++] Remove _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION.
Sun, Jan 29, 7:16 AM · Restricted Project, Restricted Project
philnik added inline comments to D142811: [libcxx][ranges] revert join_view::iterator and sentinel to be in-class.
Sun, Jan 29, 6:50 AM · Restricted Project, Restricted Project
philnik added a comment to D142841: [libc++] Implement P2520R0: `move_iterator<T*>` should be a random access iterator.

Someone else is already working on this: D135248

Sun, Jan 29, 6:41 AM · Restricted Project, Restricted Project
philnik added inline comments to D142608: [libc++] Add [[clang::lifetimebound]] to min/max algorithms.
Sun, Jan 29, 5:01 AM · Restricted Project, Restricted Project

Sat, Jan 28

philnik accepted D142809: [libc++] Addresses LWG3754.

Do we want to cherry-pick this? It's not super important, but also really small.

Sat, Jan 28, 7:02 AM · Restricted Project, Restricted Project
philnik updated subscribers of D142806: [libc++] Implement P0226R1 (Mathematical Special Functions).
Sat, Jan 28, 5:19 AM · Restricted Project, Restricted Project
philnik requested review of D142806: [libc++] Implement P0226R1 (Mathematical Special Functions).
Sat, Jan 28, 5:17 AM · Restricted Project, Restricted Project

Thu, Jan 26

philnik accepted D142657: [libc++] Add missing include promote.h in <cmath>.
Thu, Jan 26, 11:53 AM · Restricted Project, Restricted Project
philnik retitled D142608: [libc++] Add [[clang::lifetimebound]] to min/max algorithms from [lic++] Add [[clang::lifetimebound]] to min/max algorithms to [libc++] Add [[clang::lifetimebound]] to min/max algorithms.
Thu, Jan 26, 2:54 AM · Restricted Project, Restricted Project
philnik updated the diff for D139554: [libc++] Forward to std::memcmp for trivially comparable types in equal.

Try to fix CI

Thu, Jan 26, 1:48 AM · Restricted Project, Restricted Project
philnik requested review of D142608: [libc++] Add [[clang::lifetimebound]] to min/max algorithms.
Thu, Jan 26, 1:04 AM · Restricted Project, Restricted Project
philnik committed rGba43f3e85739: [libc++][NFC] Rename multidimentional uninitialized algorithms (authored by philnik).
[libc++][NFC] Rename multidimentional uninitialized algorithms
Thu, Jan 26, 12:59 AM · Restricted Project, Restricted Project
philnik closed D142526: [libc++][NFC] Rename multidimentional uninitialized algorithms.
Thu, Jan 26, 12:58 AM · Restricted Project, Restricted Project

Wed, Jan 25

philnik committed rG490555026821: [ASan][libcxx] Annotating std::vector with all allocators (authored by AdvenamTacet).
[ASan][libcxx] Annotating std::vector with all allocators
Wed, Jan 25, 10:04 AM · Restricted Project, Restricted Project
philnik closed D136765: [ASan][libcxx] Annotating std::vector with all allocators.
Wed, Jan 25, 10:04 AM · Restricted Project, Restricted Project, Restricted Project
philnik retitled D142526: [libc++][NFC] Rename multidimentional uninitialized algorithms from [libc++] Rename multidimentional uninitialized algorithms to [libc++][NFC] Rename multidimentional uninitialized algorithms.
Wed, Jan 25, 9:52 AM · Restricted Project, Restricted Project
philnik added inline comments to D142526: [libc++][NFC] Rename multidimentional uninitialized algorithms.
Wed, Jan 25, 9:52 AM · Restricted Project, Restricted Project
philnik requested review of D142526: [libc++][NFC] Rename multidimentional uninitialized algorithms.
Wed, Jan 25, 1:02 AM · Restricted Project, Restricted Project

Tue, Jan 24

philnik added inline comments to D141971: [libc++] Document how to build and run clang-tidy checks.
Tue, Jan 24, 10:19 PM · Restricted Project, Restricted Project
philnik accepted D142521: [libc++][ranges][NFC] Move iterator classes out of `lazy_split_view` and `zip_view`..

Do you know whether those are the last ones?

Tue, Jan 24, 9:49 PM · Restricted Project, Restricted Project
philnik added a comment to D136765: [ASan][libcxx] Annotating std::vector with all allocators.

I see that the revision is accepted, but based on the inline commit, I updated static_assert.
Now TEST_ALIGNOF is used instead of two cases with #if.

I do not have commiter permissions.

Tue, Jan 24, 6:53 AM · Restricted Project, Restricted Project, Restricted Project
philnik requested review of D142433: [libc++][NFC] Format __split_buffer and move constructors that are marked inline into the class body.
Tue, Jan 24, 12:32 AM · Restricted Project, Restricted Project

Mon, Jan 23

philnik abandoned D125633: [pstl] Add macro guards to PSTL.
Mon, Jan 23, 11:44 PM · Restricted Project, Restricted Project
philnik accepted D136765: [ASan][libcxx] Annotating std::vector with all allocators.

LGTM % nit.

Mon, Jan 23, 10:29 PM · Restricted Project, Restricted Project, Restricted Project
philnik updated the diff for D142332: [libc++] Add hide_from_abi check for classes.

Try to fix CI

Mon, Jan 23, 6:51 AM · Restricted Project, Restricted Project
philnik requested review of D142332: [libc++] Add hide_from_abi check for classes.
Mon, Jan 23, 1:27 AM · Restricted Project, Restricted Project

Sun, Jan 22

philnik requested review of D142322: [libc++] Add a clang-tidy check to make sure we use _Uglyfied attribute names.
Sun, Jan 22, 8:12 PM · Restricted Project, Restricted Project
philnik committed rG06385491a6d4: [libc++] Refactor clang-query checks to clang-tidy checks to get less obscure… (authored by philnik).
[libc++] Refactor clang-query checks to clang-tidy checks to get less obscure…
Sun, Jan 22, 8:01 PM · Restricted Project, Restricted Project
philnik closed D141805: [libc++] Refactor clang-query checks to clang-tidy checks to get less obscure error messages.
Sun, Jan 22, 8:01 PM · Restricted Project, Restricted Project
philnik committed rG7458908f12da: [libc++] Improve binary size when using __transaction (authored by philnik).
[libc++] Improve binary size when using __transaction
Sun, Jan 22, 7:57 PM · Restricted Project, Restricted Project
philnik closed D133661: [libc++] Improve binary size when using __transaction.
Sun, Jan 22, 7:57 PM · Restricted Project, Restricted Project
philnik added inline comments to D136765: [ASan][libcxx] Annotating std::vector with all allocators.
Sun, Jan 22, 7:25 PM · Restricted Project, Restricted Project, Restricted Project
philnik added a comment to D142285: [libc++] Don't include <version> everywhere.

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

The main benefit is avoiding the portability pitfall.

That's a pitfall we have with our current design, but instead we create a language version upgrade pitfall in libc++. This means users who don't care about portability may get caught in this trap. I much rather have the portability trap, than the upgrade trap. (Preferable I would have no traps, but that ship has sailed years ago.)

There is no reason to use FTMs if you use only a single standard library though. They are only useful if you want your code to be portable.

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.

What exactly would be the problem? It's not significantly different from having #include <__config> or #pragma GCC system_header everywhere.

The difference is I need to type these lines. Now the header needs a magic comment to include an auto-generated part. Some headers don't have the new magic, like ratio. So when there will be an update to ratio (for example https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2734r0.pdf) the update script won't work out-of-the-box. So we need additional instructions on how to use the update script cmake target.

The scripts tells you that they are missing when they are.

Sun, Jan 22, 7:04 AM · Restricted Project, Restricted Project
philnik added a comment to D142285: [libc++] Don't include <version> everywhere.

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

The main benefit is avoiding the portability pitfall.

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.

What exactly would be the problem? It's not significantly different from having #include <__config> or #pragma GCC system_header everywhere.

  • 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.)

This is also the case when switching implementations, which is a portability pitfall right now.

  • since we don't want to break older language versions we now duplicate the macros.

I'm not sure what you mean. The macros would be defined in multiple places regardless of keeping includes.

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?

Sun, Jan 22, 5:45 AM · Restricted Project, Restricted Project
philnik added a comment to D142302: [libc++][format] Fixes usage of contiguous ranges..

We have iterators of all categories (and sized/unsized sentinels) in test_iterators.h. Why don't you use them?

Sun, Jan 22, 4:37 AM · Restricted Project, Restricted Project
philnik abandoned D122675: [libc++] Use [[no_unique_address]] directly proof-of-concept.
Sun, Jan 22, 2:11 AM · Restricted Project, Restricted Project

Sat, Jan 21

philnik committed rG3ed8b93714c6: [libc++] Rename take_while_view::__sentinel to __take_while_view_sentinel (authored by philnik).
[libc++] Rename take_while_view::__sentinel to __take_while_view_sentinel
Sat, Jan 21, 10:44 PM · Restricted Project, Restricted Project
philnik closed D142276: [libc++] Rename take_while_view::__sentinel to __take_while_view_sentinel.
Sat, Jan 21, 10:44 PM · Restricted Project, Restricted Project
philnik updated the diff for D142285: [libc++] Don't include <version> everywhere.

Try to fix CI

Sat, Jan 21, 6:44 PM · Restricted Project, Restricted Project
philnik requested review of D142294: [libc++] Allow transforming to a different type in transform_inclusive_scan.
Sat, Jan 21, 6:18 PM · Restricted Project, Restricted Project
philnik updated the diff for D142285: [libc++] Don't include <version> everywhere.

Try to fix CI

Sat, Jan 21, 5:37 PM · Restricted Project, Restricted Project
philnik requested review of D142285: [libc++] Don't include <version> everywhere.
Sat, Jan 21, 8:05 AM · Restricted Project, Restricted Project
philnik committed rGfafed06b2ea9: [libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine> (authored by philnik).
[libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine>
Sat, Jan 21, 6:09 AM · Restricted Project, Restricted Project
philnik closed D140600: [libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine>.
Sat, Jan 21, 6:09 AM · Restricted Project, Restricted Project
philnik committed rG987f08fe229c: [libc++] Implement P1413R3 (Deprecate std::aligned_storage and std… (authored by philnik).
[libc++] Implement P1413R3 (Deprecate std::aligned_storage and std…
Sat, Jan 21, 6:08 AM · Restricted Project, Restricted Project
philnik closed D127678: [libc++] Implement P1413R3 (Deprecate std::aligned_storage and std::aligned_union).
Sat, Jan 21, 6:08 AM · Restricted Project, Restricted Project
philnik added inline comments to D142063: [libc++][ranges] implement `std::ranges::split_view` (targeting llvm 16).
Sat, Jan 21, 5:30 AM · Restricted Project, Restricted Project
philnik updated the diff for D127678: [libc++] Implement P1413R3 (Deprecate std::aligned_storage and std::aligned_union).

Try to fix CI

Sat, Jan 21, 12:00 AM · Restricted Project, Restricted Project

Fri, Jan 20

philnik requested review of D142276: [libc++] Rename take_while_view::__sentinel to __take_while_view_sentinel.
Fri, Jan 20, 11:35 PM · Restricted Project, Restricted Project
philnik updated the diff for D140600: [libc++] Granularize <type_traits> includes in <bit>, <numbers> and <coroutine>.

Don't remove includes in older versions

Fri, Jan 20, 11:14 PM · Restricted Project, Restricted Project