diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-07-12 00:30:24 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2024-07-31 17:07:10 +0100 |
commit | 72cd15b20a887bed9b0b1f4196be99fe052247b4 (patch) | |
tree | 2a6530a0e43f98671d9d9b65c10cfca8617b21cc /libstdc++-v3/testsuite | |
parent | 74b5101cc9e297f7c530642553e3498d4d705cf4 (diff) | |
download | gcc-72cd15b20a887bed9b0b1f4196be99fe052247b4.zip gcc-72cd15b20a887bed9b0b1f4196be99fe052247b4.tar.gz gcc-72cd15b20a887bed9b0b1f4196be99fe052247b4.tar.bz2 |
libstdc++: Support P2510R3 "Formatting pointers" as a DR for C++20
We already enable this for -std=gnu++20 but we can do it for -std=c++20
too. Both libc++ and MSVC also treat this change as a DR for C++20.
Now that the previous change to the value of __cpp_lib_format is
supported, we can finally update it to 202304 to indicate support for
this feature too.
libstdc++-v3/ChangeLog:
* include/bits/version.def (format): Update value for P2510R3.
* include/bits/version.h: Regenerate.
* include/std/format (_GLIBCXX_P2518R3): Remove misspelled macro
and check __glibcxx_format instead.
* testsuite/std/format/functions/format.cc: Check value of the
__cpp_lib_format macro for formatting pointers support.
* testsuite/std/format/parse_ctx.cc: Likewise.
Diffstat (limited to 'libstdc++-v3/testsuite')
-rw-r--r-- | libstdc++-v3/testsuite/std/format/functions/format.cc | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/std/format/parse_ctx.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/testsuite/std/format/functions/format.cc b/libstdc++-v3/testsuite/std/format/functions/format.cc index 78cc1ab..5152bb0 100644 --- a/libstdc++-v3/testsuite/std/format/functions/format.cc +++ b/libstdc++-v3/testsuite/std/format/functions/format.cc @@ -458,7 +458,7 @@ test_pointer() s = std::format("{:20} {:20p}", p, pc); VERIFY( s == (str_int + ' ' + str_int) ); -#if __cplusplus > 202302L || ! defined __STRICT_ANSI__ +#if __cpp_lib_format >= 202304L // P2510R3 Formatting pointers s = std::format("{:06} {:07P} {:08p}", (void*)0, (const void*)0, nullptr); VERIFY( s == "0x0000 0X00000 0x000000" ); diff --git a/libstdc++-v3/testsuite/std/format/parse_ctx.cc b/libstdc++-v3/testsuite/std/format/parse_ctx.cc index 497427b..3b3201c 100644 --- a/libstdc++-v3/testsuite/std/format/parse_ctx.cc +++ b/libstdc++-v3/testsuite/std/format/parse_ctx.cc @@ -266,8 +266,8 @@ test_pointer() VERIFY( ! is_std_format_spec_for<void*>("G") ); VERIFY( ! is_std_format_spec_for<void*>("+p") ); -#if __cplusplus > 202302L || ! defined __STRICT_ANSI__ - // As an extension, we support P2510R3 Formatting pointers +#if __cpp_lib_format >= 202304L + // P2510R3 Formatting pointers VERIFY( is_std_format_spec_for<void*>("P") ); VERIFY( is_std_format_spec_for<void*>("0p") ); VERIFY( is_std_format_spec_for<void*>("0P") ); |