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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 22 05:45:19 PST 2023


philnik added a comment.

In D142285#4071753 <https://reviews.llvm.org/D142285#4071753>, @Mordante wrote:

> 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?




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