Skip to content

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented Mar 3, 2024

The parse.pass.cpp tests doen't need to call test_format_context_create to create a basic_format_context, so they shouldn't include test_format_context.h.

The to_address mechanism works around the iterator debugging mechanisms of MSVC STL. Related to LWG3989.

Discovered when implementing formatter<tuple> in MSVC STL. With the inclusion removed, std/utilities/format/format.tuple/parse.pass.cpp when using enhanced MSVC STL (and /utf-8 option for MSVC).

…/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.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner March 3, 2024 18:10
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Mar 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 3, 2024

@llvm/pr-subscribers-libcxx

Author: A. Jiang (frederick-vs-ja)

Changes

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&lt;tuple&gt; in MSVC STL. With the inclusion removed, local test passes when using enhanced MSVC STL.


Full diff: https://github.com/llvm/llvm-project/pull/83734.diff

1 Files Affected:

  • (modified) libcxx/test/std/utilities/format/format.tuple/parse.pass.cpp (-1)
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"
 

@mordante mordante self-assigned this Mar 3, 2024
@frederick-vs-ja frederick-vs-ja changed the title [libc++][test] Don't include test_format_context.h in format.tuple/parse.pass.cpp [libc++][test] Don't include test_format_context.h in parse.pass.cpp Mar 3, 2024
Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM!

@ldionne
Copy link
Member

ldionne commented Mar 11, 2024

Merging. The CI failures are flukes.

@ldionne ldionne merged commit 63ae509 into llvm:main Mar 11, 2024
@frederick-vs-ja frederick-vs-ja deleted the redux-test_format_context.h branch March 11, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants