[libcxx-commits] [libcxx] [libc++] Simplify __bitset::__init (PR #121357)
Peng Liu via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 27 09:24:53 PST 2025
winner245 wrote:
After several attempts with a [stage1 (generic-gcc, gcc-14, g++-14) CI failure](https://github.com/llvm/llvm-project/actions/runs/13570938788/job/37935502660?pr=121357#logs), I realized that we still have to keep the initialization of the `__first_` array in the constructor initializer list, because the constructor is `constexpr` since C++11, whereas C++11 `constexpr` constructor body does not allow statements other than the following: null statements, `static_assert`, `typedef` or alias declarations, using declarations/directives. Thus, gcc is unable to compile it ([A reproducer](https://godbolt.org/z/n99666xf5)) and that's why the generic-gcc CI fails.
Given this limitation, it seems that we still have to move the initialization back to the constructor initializer list. Since C++03 does not support `{}` in the constructor initializer list, I think we still need to keep the `__init` function for C++03. Please let me know if you have different opinions.
https://github.com/llvm/llvm-project/pull/121357
More information about the libcxx-commits
mailing list