[libcxx-commits] [libcxx] [libc++][test] Don't include `test_format_context.h` in `format.tuple/parse.pass.cpp` (PR #83734)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Mar 3 10:37:09 PST 2024
https://github.com/frederick-vs-ja updated https://github.com/llvm/llvm-project/pull/83734
>From 3cbe4fe17a29c7c5d51940b49e235d38f7c8aeff Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Mon, 4 Mar 2024 02:08:42 +0800
Subject: [PATCH 1/2] [libc++][test] Don't include `test_format_context.h` in
`format.tuple/parse.pass.cpp`
The test doesn't need to call `test_format_context_create` to create a `basic_format_context`, so it shouldn't include `test_format_context.h`.
Discovered when implementing `formatter<tuple>` in MSVC STL. With the inclusion removed, local test passes when using enhanced MSVC STL.
---
libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp | 1 -
1 file changed, 1 deletion(-)
diff --git a/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp b/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
index 5cabbda63dd02e..313f8ef8d220d0 100644
--- a/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
@@ -27,7 +27,6 @@
#include <tuple>
#include <utility>
-#include "test_format_context.h"
#include "test_macros.h"
#include "make_string.h"
>From 21c888b9bd59352e48ecc920afee868a317988cd Mon Sep 17 00:00:00 2001
From: "A. Jiang" <de34 at live.cn>
Date: Mon, 4 Mar 2024 02:37:02 +0800
Subject: [PATCH 2/2] Workaround for MSVC STL and LWG3989
---
libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp b/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
index 313f8ef8d220d0..73b7b0e3e7016c 100644
--- a/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
+++ b/libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp
@@ -24,6 +24,7 @@
#include <cassert>
#include <concepts>
#include <format>
+#include <memory>
#include <tuple>
#include <utility>
@@ -40,7 +41,7 @@ constexpr void test(StringViewT fmt, std::size_t offset) {
static_assert(std::semiregular<decltype(formatter)>);
std::same_as<typename StringViewT::iterator> auto it = formatter.parse(parse_ctx);
- assert(it == fmt.end() - offset);
+ assert(std::to_address(it) == std::to_address(fmt.end()) - offset);
}
template <class CharT, class Arg>
More information about the libcxx-commits
mailing list