Skip to content
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

Removed duplicated _LIBCPP_HIDE_FROM_ABI in libcxx #122323

Merged
merged 3 commits into from
Jan 10, 2025
Merged

Conversation

2LoS
Copy link
Contributor

@2LoS 2LoS commented Jan 9, 2025

No description provided.

@2LoS 2LoS requested a review from a team as a code owner January 9, 2025 17:40
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 9, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 9, 2025

@llvm/pr-subscribers-libcxx

Author: LoS (2LoS)

Changes

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

6 Files Affected:

  • (modified) libcxx/include/__cxx03/__functional/function.h (+1-1)
  • (modified) libcxx/include/__cxx03/future (+1-1)
  • (modified) libcxx/include/__cxx03/regex (+1-3)
  • (modified) libcxx/include/__functional/function.h (+16-16)
  • (modified) libcxx/include/future (+1-1)
  • (modified) libcxx/include/regex (+12-14)
diff --git a/libcxx/include/__cxx03/__functional/function.h b/libcxx/include/__cxx03/__functional/function.h
index 1d60391494da80..891652f1da25f6 100644
--- a/libcxx/include/__cxx03/__functional/function.h
+++ b/libcxx/include/__cxx03/__functional/function.h
@@ -853,7 +853,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
 
   // construct/copy/destroy:
   _LIBCPP_HIDE_FROM_ABI function() _NOEXCEPT {}
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {}
+  _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {}
   _LIBCPP_HIDE_FROM_ABI function(const function&);
   _LIBCPP_HIDE_FROM_ABI function(function&&) _NOEXCEPT;
   template <class _Fp, class = _EnableIfLValueCallable<_Fp>>
diff --git a/libcxx/include/__cxx03/future b/libcxx/include/__cxx03/future
index f92bc1266939ef..9f43b87e04f322 100644
--- a/libcxx/include/__cxx03/future
+++ b/libcxx/include/__cxx03/future
@@ -1472,7 +1472,7 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI void swap(__packaged_task_function&) _NOEXCEPT;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
+  _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
 };
 
 template <class _Rp, class... _ArgTypes>
diff --git a/libcxx/include/__cxx03/regex b/libcxx/include/__cxx03/regex
index c05c8768a89a19..ea9512cd56953e 100644
--- a/libcxx/include/__cxx03/regex
+++ b/libcxx/include/__cxx03/regex
@@ -5544,9 +5544,7 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI bool operator==(const regex_token_iterator& __x) const;
 #if _LIBCPP_STD_VER >= 20
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const {
-    return *this == regex_token_iterator();
-  }
+  _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); }
 #endif
 #if _LIBCPP_STD_VER < 20
   _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_token_iterator& __x) const { return !(*this == __x); }
diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h
index b483e8ea8f8567..a23a895a70319b 100644
--- a/libcxx/include/__functional/function.h
+++ b/libcxx/include/__functional/function.h
@@ -518,13 +518,13 @@ struct __policy {
 
   _LIBCPP_HIDE_FROM_ABI static const __policy* __create_empty() {
     static constexpr __policy __policy = {
-        nullptr,
-        nullptr,
-        true,
+      nullptr,
+      nullptr,
+      true,
 #  if _LIBCPP_HAS_RTTI
-        &typeid(void)
+      &typeid(void)
 #  else
-        nullptr
+      nullptr
 #  endif
     };
     return &__policy;
@@ -545,13 +545,13 @@ struct __policy {
   template <typename _Fun>
   _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ false_type) {
     static constexpr __policy __policy = {
-        &__large_clone<_Fun>,
-        &__large_destroy<_Fun>,
-        false,
+      &__large_clone<_Fun>,
+      &__large_destroy<_Fun>,
+      false,
 #  if _LIBCPP_HAS_RTTI
-        &typeid(typename _Fun::_Target)
+      &typeid(typename _Fun::_Target)
 #  else
-        nullptr
+      nullptr
 #  endif
     };
     return &__policy;
@@ -560,13 +560,13 @@ struct __policy {
   template <typename _Fun>
   _LIBCPP_HIDE_FROM_ABI static const __policy* __choose_policy(/* is_small = */ true_type) {
     static constexpr __policy __policy = {
-        nullptr,
-        nullptr,
-        false,
+      nullptr,
+      nullptr,
+      false,
 #  if _LIBCPP_HAS_RTTI
-        &typeid(typename _Fun::_Target)
+      &typeid(typename _Fun::_Target)
 #  else
-        nullptr
+      nullptr
 #  endif
     };
     return &__policy;
@@ -854,7 +854,7 @@ class _LIBCPP_TEMPLATE_VIS function<_Rp(_ArgTypes...)>
 
   // construct/copy/destroy:
   _LIBCPP_HIDE_FROM_ABI function() _NOEXCEPT {}
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {}
+  _LIBCPP_HIDE_FROM_ABI function(nullptr_t) _NOEXCEPT {}
   _LIBCPP_HIDE_FROM_ABI function(const function&);
   _LIBCPP_HIDE_FROM_ABI function(function&&) _NOEXCEPT;
   template <class _Fp, class = _EnableIfLValueCallable<_Fp>>
diff --git a/libcxx/include/future b/libcxx/include/future
index 95a51fa425e411..d777ed8d6016f3 100644
--- a/libcxx/include/future
+++ b/libcxx/include/future
@@ -1492,7 +1492,7 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI void swap(__packaged_task_function&) _NOEXCEPT;
 
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
+  _LIBCPP_HIDE_FROM_ABI _Rp operator()(_ArgTypes...) const;
 };
 
 template <class _Rp, class... _ArgTypes>
diff --git a/libcxx/include/regex b/libcxx/include/regex
index 5cad0bc4b812d6..57fdadbdc1b2f7 100644
--- a/libcxx/include/regex
+++ b/libcxx/include/regex
@@ -842,20 +842,20 @@ namespace regex_constants {
 // syntax_option_type
 
 enum syntax_option_type {
-  icase    = 1 << 0,
-  nosubs   = 1 << 1,
-  optimize = 1 << 2,
-  collate  = 1 << 3,
+  icase      = 1 << 0,
+  nosubs     = 1 << 1,
+  optimize   = 1 << 2,
+  collate    = 1 << 3,
 #  ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO
   ECMAScript = 1 << 9,
 #  else
   ECMAScript = 0,
 #  endif
-  basic    = 1 << 4,
-  extended = 1 << 5,
-  awk      = 1 << 6,
-  grep     = 1 << 7,
-  egrep    = 1 << 8,
+  basic      = 1 << 4,
+  extended   = 1 << 5,
+  awk        = 1 << 6,
+  grep       = 1 << 7,
+  egrep      = 1 << 8,
   // 1 << 9 may be used by ECMAScript
   multiline = 1 << 10
 };
@@ -5548,9 +5548,7 @@ public:
 
   _LIBCPP_HIDE_FROM_ABI bool operator==(const regex_token_iterator& __x) const;
 #  if _LIBCPP_STD_VER >= 20
-  _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const {
-    return *this == regex_token_iterator();
-  }
+  _LIBCPP_HIDE_FROM_ABI bool operator==(default_sentinel_t) const { return *this == regex_token_iterator(); }
 #  endif
 #  if _LIBCPP_STD_VER < 20
   _LIBCPP_HIDE_FROM_ABI bool operator!=(const regex_token_iterator& __x) const { return !(*this == __x); }
@@ -5811,8 +5809,8 @@ template <class _BidirT>
 using match_results _LIBCPP_AVAILABILITY_PMR =
     std::match_results<_BidirT, polymorphic_allocator<std::sub_match<_BidirT>>>;
 
-using cmatch _LIBCPP_AVAILABILITY_PMR = match_results<const char*>;
-using smatch _LIBCPP_AVAILABILITY_PMR = match_results<std::pmr::string::const_iterator>;
+using cmatch _LIBCPP_AVAILABILITY_PMR  = match_results<const char*>;
+using smatch _LIBCPP_AVAILABILITY_PMR  = match_results<std::pmr::string::const_iterator>;
 
 #    if _LIBCPP_HAS_WIDE_CHARACTERS
 using wcmatch _LIBCPP_AVAILABILITY_PMR = match_results<const wchar_t*>;

Copy link

github-actions bot commented Jan 9, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@2LoS
Copy link
Contributor Author

2LoS commented Jan 9, 2025

I used clang-format to format code, but it seems checks for code formatting still fail.

Am I missing anything?

@ldionne
Copy link
Member

ldionne commented Jan 10, 2025

I used clang-format to format code, but it seems checks for code formatting still fail.

Am I missing anything?

What version of clang-format are you using locally? We're using 19.1.6 in the CI. That could be the reason.
Edit: And indeed, when I pull your patch locally and apply my own clang-format to these files, I see that your clang-format formatting doesn't correspond to what I get locally either (I get what the CI produces). So I suspect that's the reason.

One thing you can do is apply the diff (provided in #122323 (comment)) to your patch. That's the diff that would make the CI job pass.

Edit: For now, I pulled your patch and should have fixed the formatting.

Copy link
Member

@ldionne ldionne left a comment

Choose a reason for hiding this comment

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

Thanks for the patch, that's a good catch!

@ldionne ldionne merged commit dab6463 into llvm:main Jan 10, 2025
12 of 17 checks passed
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