Merge commit cb7a03b41fff from llvm git (by Nikolas Klauser):
[libc++] Fix failures with GCC 14 (#92663) Fixes #91831
Reviewed by: dim
Differential Revision: https://reviews.freebsd.org/D46003
(cherry picked from commit 9bc300465e48e19d794d88d0c158a2adb92c7197)