libstdc++: Fix constexpr functions to conform to older standards
commitb3a2b307b9deea719fb725a86df43b82176fe459
authorJonathan Wakely <jwakely@redhat.com>
Wed, 9 Aug 2023 10:11:31 +0000 (9 11:11 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 9 Aug 2023 14:19:16 +0000 (9 15:19 +0100)
treee333a681dfdd2492cb7b1820802263b5f253d4c5
parent9bd194434acb47fac80aad45ed04039e0535d1fe
libstdc++: Fix constexpr functions to conform to older standards

Some constexpr functions were inadvertently relying on relaxed constexpr
rules from later standards.

libstdc++-v3/ChangeLog:

* include/bits/chrono.h (duration_cast): Do not use braces
around statements for C++11 constexpr rules.
* include/bits/stl_algobase.h (__lg): Rewrite as a single
statement for C++11 constexpr rules.
* include/experimental/bits/fs_path.h (path::string): Use
_GLIBCXX17_CONSTEXPR not _GLIBCXX_CONSTEXPR for 'if constexpr'.
* include/std/charconv (__to_chars_8): Initialize variable for
C++17 constexpr rules.
libstdc++-v3/include/bits/chrono.h
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/experimental/bits/fs_path.h
libstdc++-v3/include/std/charconv