Skip to content

[libc++][test] concat_macros.h: Fix TEST_HAS_NO_WIDE_CHARACTERS syntax damage #74987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

StephanTLavavej
Copy link
Member

@mordante This was introduced by #73395 a couple of days ago.

This is causing PR checks to fail, stage3 (generic-no-wide-characters, libcxx-runners-8-set, OFF):

In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp:29:
/home/runner/_work/llvm-project/llvm-project/libcxx/test/support/concat_macros.h:86:1: error: expected ')'
   86 | OutIt test_transcode(InIt first, InIt last, OutIt out_it) {
      | ^
/home/runner/_work/llvm-project/llvm-project/libcxx/test/support/concat_macros.h:80:11: note: to match this '('
   80 |   requires(std::output_iterator<OutIt, const char&> &&
      |           ^
/home/runner/_work/llvm-project/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp:63:2: error: expected unqualified-id
   63 | }
      |  ^

@StephanTLavavej StephanTLavavej requested a review from a team as a code owner December 10, 2023 09:14
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Dec 10, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 10, 2023

@llvm/pr-subscribers-libcxx

Author: Stephan T. Lavavej (StephanTLavavej)

Changes

@mordante This was introduced by #73395 a couple of days ago.

This is causing PR checks to fail, stage3 (generic-no-wide-characters, libcxx-runners-8-set, OFF):

In file included from /home/runner/_work/llvm-project/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp:29:
/home/runner/_work/llvm-project/llvm-project/libcxx/test/support/concat_macros.h:86:1: error: expected ')'
   86 | OutIt test_transcode(InIt first, InIt last, OutIt out_it) {
      | ^
/home/runner/_work/llvm-project/llvm-project/libcxx/test/support/concat_macros.h:80:11: note: to match this '('
   80 |   requires(std::output_iterator&lt;OutIt, const char&amp;&gt; &amp;&amp;
      |           ^
/home/runner/_work/llvm-project/llvm-project/libcxx/test/std/utilities/format/format.tuple/format.functions.vformat.pass.cpp:63:2: error: expected unqualified-id
   63 | }
      |  ^

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

1 Files Affected:

  • (modified) libcxx/test/support/concat_macros.h (+5-5)
diff --git a/libcxx/test/support/concat_macros.h b/libcxx/test/support/concat_macros.h
index bc1306fbdb5331..57c5f5e0632e71 100644
--- a/libcxx/test/support/concat_macros.h
+++ b/libcxx/test/support/concat_macros.h
@@ -80,9 +80,9 @@ template <class InIt, class OutIt>
   requires(std::output_iterator<OutIt, const char&> &&
            (std::same_as<std::iter_value_t<InIt>, char16_t>
 #    ifndef TEST_HAS_NO_WIDE_CHARACTERS
-            || (std::same_as<std::iter_value_t<InIt>, wchar_t> && sizeof(wchar_t) == 2))
+            || (std::same_as<std::iter_value_t<InIt>, wchar_t> && sizeof(wchar_t) == 2)
 #    endif
-               )
+                ))
 OutIt test_transcode(InIt first, InIt last, OutIt out_it) {
   while (first != last) {
     char32_t value = *first++;
@@ -118,11 +118,11 @@ OutIt test_transcode(InIt first, InIt last, OutIt out_it) {
 
 template <class InIt, class OutIt>
   requires(std::output_iterator<OutIt, const char&> &&
-           (std::same_as<std::iter_value_t<InIt>, char32_t> ||
+           (std::same_as<std::iter_value_t<InIt>, char32_t>
 #    ifndef TEST_HAS_NO_WIDE_CHARACTERS
-            (std::same_as<std::iter_value_t<InIt>, wchar_t> && sizeof(wchar_t) == 4))
+            || (std::same_as<std::iter_value_t<InIt>, wchar_t> && sizeof(wchar_t) == 4)
 #    endif
-               )
+                ))
 OutIt test_transcode(InIt first, InIt last, OutIt out_it) {
   while (first != last) {
     char32_t value = *first++;

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 a lot! I just noticed the same in some CI runs. I've no idea how the original patch managed to pass the CI :-/

LGTM!

@mordante
Copy link
Member

It seems the CI is fixed and the other errors are unrelated. So I'm merging this.

@mordante mordante merged commit 99eb843 into llvm:main Dec 10, 2023
@StephanTLavavej StephanTLavavej deleted the stl-29-fix-concat_macros branch December 10, 2023 15:16
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.

3 participants