[libcxx-commits] [libcxx] [libc++] Make map constexpr as part of P3372R3 (PR #134330)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 10 20:25:41 PDT 2025
frederick-vs-ja wrote:
> I did find this commit that mentions that the code is UB (slightly less than previously), so maybe `constexpr` flagging that is expected
>
> f52318b47b333126c862d9a973d6e59ccaf713dc | https://reviews.llvm.org/D47607
This is clearly UB in the core language. Per current rules we can't assign the `first` data member of a `pair<const int, int>`, even when the complete object is non-const.
IIUC we need to perform different operations (e.g. reconstructing the node) in constant evaluation.
https://github.com/llvm/llvm-project/pull/134330
More information about the libcxx-commits
mailing list