aboutsummaryrefslogtreecommitdiff
path: root/libcxx/include/tuple
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2023-01-23 10:27:14 +0100
committerNikolas Klauser <nikolasklauser@berlin.de>2023-04-16 15:23:23 +0200
commit83ce139721260d176773d811f576289370f3313c (patch)
treeb99f8b52d8bdd04d9b6f42caa71008691369714e /libcxx/include/tuple
parentb34ca0851a5209a10c0ca285c000a18073677891 (diff)
downloadllvm-83ce139721260d176773d811f576289370f3313c.zip
llvm-83ce139721260d176773d811f576289370f3313c.tar.gz
llvm-83ce139721260d176773d811f576289370f3313c.tar.bz2
[libc++] Add hide_from_abi check for classes
We already have a clang-tidy check for making sure that `_LIBCPP_HIDE_FROM_ABI` is on free functions. This patch extends this to class members. The places where we don't check for `_LIBCPP_HIDE_FROM_ABI` are classes for which we have an instantiation in the library. Reviewed By: ldionne, Mordante, #libc Spies: jplehr, mikhail.ramalho, sstefan1, libcxx-commits, krytarowski, miyuki, smeenai Differential Revision: https://reviews.llvm.org/D142332
Diffstat (limited to 'libcxx/include/tuple')
-rw-r--r--libcxx/include/tuple9
1 files changed, 4 insertions, 5 deletions
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index abfd441..9ef197f 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -295,7 +295,7 @@ class __tuple_leaf
_Hp __value_;
template <class _Tp>
- static constexpr bool __can_bind_reference() {
+ static _LIBCPP_HIDE_FROM_ABI constexpr bool __can_bind_reference() {
#if __has_keyword(__reference_binds_to_temporary)
return !__reference_binds_to_temporary(_Hp, _Tp);
#else
@@ -367,8 +367,8 @@ public:
{static_assert(!is_reference<_Hp>::value,
"Attempted to uses-allocator construct a reference element in a tuple");}
- __tuple_leaf(const __tuple_leaf& __t) = default;
- __tuple_leaf(__tuple_leaf&& __t) = default;
+ _LIBCPP_HIDE_FROM_ABI __tuple_leaf(const __tuple_leaf& __t) = default;
+ _LIBCPP_HIDE_FROM_ABI __tuple_leaf(__tuple_leaf&& __t) = default;
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
int swap(__tuple_leaf& __t) _NOEXCEPT_(__is_nothrow_swappable<__tuple_leaf>::value)
@@ -1308,8 +1308,7 @@ template <>
class _LIBCPP_TEMPLATE_VIS tuple<>
{
public:
- _LIBCPP_INLINE_VISIBILITY constexpr
- tuple() _NOEXCEPT = default;
+ constexpr tuple() _NOEXCEPT = default;
template <class _Alloc>
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
tuple(allocator_arg_t, const _Alloc&) _NOEXCEPT {}