Skip to content

Commit

Permalink
[libc++] Declare <compare> operators with the proper visibility attri…
Browse files Browse the repository at this point in the history
…bute

Summary:
Many operators in <compare> were _defined_ with the proper visibility attribute,
but they were _declared_ without any. This is not a problem until we change the
definition of _LIBCPP_INLINE_VISIBILITY to something that requires the
declaration to be decorated.

I also marked `strong_equality::operator weak_equality()` as
`_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten.

This came up while trying to get rid of `__attribute__((__always_inline__))`
in favor of `__attribute__((internal_linkage))`.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49104

llvm-svn: 336665
  • Loading branch information
ldionne committed Jul 10, 2018
1 parent 641097d commit be4d99d
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions libcxx/include/compare
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ public:
static const weak_equality equivalent;
static const weak_equality nonequivalent;

friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, weak_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_equality __v) noexcept;

#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality operator<=>(weak_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_equality operator<=>(_CmpUnspecifiedParam, weak_equality __v) noexcept;
#endif

private:
Expand Down Expand Up @@ -148,20 +148,20 @@ public:
static const strong_equality nonequivalent;

// conversion
constexpr operator weak_equality() const noexcept {
_LIBCPP_INLINE_VISIBILITY constexpr operator weak_equality() const noexcept {
return __value_ == _EqResult::__zero ? weak_equality::equivalent
: weak_equality::nonequivalent;
}

// comparisons
friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, strong_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_equality __v) noexcept;

#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality operator<=>(strong_equality __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_equality operator<=>(_CmpUnspecifiedParam, strong_equality __v) noexcept;
#endif
private:
_EqResult __value_;
Expand Down Expand Up @@ -235,22 +235,22 @@ public:
}

// comparisons
friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
friend constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, partial_ordering __v) noexcept;

#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(partial_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr partial_ordering operator<=>(_CmpUnspecifiedParam, partial_ordering __v) noexcept;
#endif

private:
Expand Down Expand Up @@ -351,22 +351,22 @@ public:
}

// comparisons
friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, weak_ordering __v) noexcept;

#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(weak_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr weak_ordering operator<=>(_CmpUnspecifiedParam, weak_ordering __v) noexcept;
#endif

private:
Expand Down Expand Up @@ -477,22 +477,22 @@ public:
}

// comparisons
friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator==(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator!=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator< (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator<=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator> (_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr bool operator>=(_CmpUnspecifiedParam, strong_ordering __v) noexcept;

#ifndef _LIBCPP_HAS_NO_SPACESHIP_OPERATOR
friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(strong_ordering __v, _CmpUnspecifiedParam) noexcept;
_LIBCPP_INLINE_VISIBILITY friend constexpr strong_ordering operator<=>(_CmpUnspecifiedParam, strong_ordering __v) noexcept;
#endif

private:
Expand Down

0 comments on commit be4d99d

Please sign in to comment.