Skip to content

[libc++] Fix usage of 'exclude_from_explicit_instantiation' attribute on local class members #89377

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
Apr 19, 2024

Conversation

sdkrystian
Copy link
Member

#88777 adds a warning for when the exclude_from_explicit_instantiation attribute is applied to local classes and members thereof. This patch addresses the few instances of exclude_from_explicit_instantiation being applied to local class members in libc++.

@sdkrystian sdkrystian requested a review from a team as a code owner April 19, 2024 12:24
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Apr 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 19, 2024

@llvm/pr-subscribers-libcxx

Author: Krystian Stasiowski (sdkrystian)

Changes

#88777 adds a warning for when the exclude_from_explicit_instantiation attribute is applied to local classes and members thereof. This patch addresses the few instances of exclude_from_explicit_instantiation being applied to local class members in libc++.


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

2 Files Affected:

  • (modified) libcxx/include/__memory/uses_allocator_construction.h (+4-4)
  • (modified) libcxx/include/variant (+2-2)
diff --git a/libcxx/include/__memory/uses_allocator_construction.h b/libcxx/include/__memory/uses_allocator_construction.h
index 9b7262bec5cf8b..11f59980ed0091 100644
--- a/libcxx/include/__memory/uses_allocator_construction.h
+++ b/libcxx/include/__memory/uses_allocator_construction.h
@@ -184,19 +184,19 @@ __uses_allocator_construction_args(const _Alloc& __alloc, _Type&& __value) noexc
   struct __pair_constructor {
     using _PairMutable = remove_cv_t<_Pair>;
 
-    _LIBCPP_HIDE_FROM_ABI constexpr auto __do_construct(const _PairMutable& __pair) const {
+    _LIBCPP_HIDDEN constexpr auto __do_construct(const _PairMutable& __pair) const {
       return std::__make_obj_using_allocator<_PairMutable>(__alloc_, __pair);
     }
 
-    _LIBCPP_HIDE_FROM_ABI constexpr auto __do_construct(_PairMutable&& __pair) const {
+    _LIBCPP_HIDDEN constexpr auto __do_construct(_PairMutable&& __pair) const {
       return std::__make_obj_using_allocator<_PairMutable>(__alloc_, std::move(__pair));
     }
 
     const _Alloc& __alloc_;
     _Type& __value_;
 
-    _LIBCPP_HIDE_FROM_ABI constexpr operator _PairMutable() const {
-      return __do_construct(std::forward<_Type>(this->__value_));
+    _LIBCPP_HIDDEN constexpr operator _PairMutable() const {
+      return __do_construct(std::forward<_Type>(__value_));
     }
   };
 
diff --git a/libcxx/include/variant b/libcxx/include/variant
index 1b5e84e9547953..858a49b980bd9a 100644
--- a/libcxx/include/variant
+++ b/libcxx/include/variant
@@ -909,8 +909,8 @@ protected:
       __a.__value = std::forward<_Arg>(__arg);
     } else {
       struct {
-        _LIBCPP_HIDE_FROM_ABI void operator()(true_type) const { __this->__emplace<_Ip>(std::forward<_Arg>(__arg)); }
-        _LIBCPP_HIDE_FROM_ABI void operator()(false_type) const {
+        _LIBCPP_HIDDEN void operator()(true_type) const { __this->__emplace<_Ip>(std::forward<_Arg>(__arg)); }
+        _LIBCPP_HIDDEN void operator()(false_type) const {
           __this->__emplace<_Ip>(_Tp(std::forward<_Arg>(__arg)));
         }
         __assignment* __this;

Copy link

github-actions bot commented Apr 19, 2024

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

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 fixing this. It's a bit unfortunate that we can't just use _LIBCPP_HIDE_FROM_ABI in all contexts, but I understand why that is and I think it's fine.

@sdkrystian sdkrystian merged commit ab22504 into llvm:main Apr 19, 2024
aniplcc pushed a commit to aniplcc/llvm-project that referenced this pull request Apr 21, 2024
… on local class members (llvm#89377)

llvm#88777 adds a warning for when the `exclude_from_explicit_instantiation`
attribute is applied to local classes and members thereof. This patch
addresses the few instances of `exclude_from_explicit_instantiation`
being applied to local class members in libc++.
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