[libcxx-commits] [libcxx] [libc++][utility] Add fallback implementation for __make_integer_sequence_impl (PR #192789)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Apr 18 08:05:38 PDT 2026


Kim-J-Smith wrote:

> I am not a big fan of supporting old compilers. We have documented the supported compilers
> https://libcxx.llvm.org/#platform-and-compiler-support

@huixie90, thank you for your review and for pointing out the official compiler support policy.

I understand your concern about adding maintenance burden for legacy compilers. However, I would like to argue that this fallback is not primarily about supporting old compilers, but about **completeness and portability of libc++ itself**.

### Why this fallback matters:

1. This code path is **only activated when both `__make_integer_seq` and `__integer_pack` are unavailable**. For all supported compilers, the builtin paths are used. The fallback is never compiled or instantiated on those configurations.
2. This exact implementation has been used in libc++ for years. (Before https://reviews.llvm.org/D14814)
3. **It enables libc++ on niche platforms.** Some custom toolchains or embedded environments could still benefit from a complete libc++. This fallback makes libc++ more portable without compromising performance or correctness on primary targets.

### On maintenance cost:

- The code is **isolated** inside `#else` branch and guarded by `__has_builtin` checks.
- *The support of the mainstream platforms will not be affected in any way*, and the completeness of libc++ has also been greatly enhanced.

I understand the policy to drop old compilers, but this patch is not about “supporting GCC 4.8” – it’s about **providing a correct, standard-compliant implementation for any C++11 compiler that lacks non-standard builtins**. This is in the spirit of libc++ as a portable, high-quality implementation.

https://github.com/llvm/llvm-project/pull/192789


More information about the libcxx-commits mailing list