libstdc++: Refactor experimental::filesystem::path string conversions
commit16491e137c47ad36f9d73f070978841f1e8ca95d
authorJonathan Wakely <jwakely@redhat.com>
Fri, 27 Sep 2024 14:53:04 +0000 (27 15:53 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 27 Sep 2024 22:55:09 +0000 (27 23:55 +0100)
tree8eddfbfc82d6d910842f798222a1d14cd136381c
parent7040c207baa6b5d5f6065a47dd3559f3d3974a1b
libstdc++: Refactor experimental::filesystem::path string conversions

I noticed a -Wc++17-extensions warning due to use of if-constexpr in
std::experimental::filesystem::path, which was not protected by
diagnostic pragmas to disable the warning.

While adding the pragmas I noticed that other places in the same file
use tag dispatching and multiple overloads instead of if-constexpr.
Since we're already using it in that file, we might as well just use it
everywhere.

libstdc++-v3/ChangeLog:

* include/experimental/bits/fs_path.h (path::_Cvt): Refactor to
use if-constexpr.
(path::string(const Allocator&)): Likewise.
libstdc++-v3/include/experimental/bits/fs_path.h