1 // RUN: %clang_cc1 --std=c++20 %s -emit-llvm -o - -triple x86_64-linux | FileCheck %s
4 struct strong_ordering
{
6 constexpr operator int() const { return n
; }
7 static const strong_ordering equal
, greater
, less
;
9 constexpr inline strong_ordering
strong_ordering::equal
= {0};
10 constexpr inline strong_ordering
strong_ordering::greater
= {1};
11 constexpr inline strong_ordering
strong_ordering::less
= {-1};
17 std::strong_ordering
operator<=>(Space
const &other
) const;
18 bool operator==(Space
const &other
) const;
21 // Make sure these cause emission
22 std::strong_ordering
Space::operator<=>(Space
const &other
) const = default;
23 // CHECK-LABEL: define{{.*}} @_ZNK5SpacessERKS_
24 bool Space::operator==(Space
const &) const = default;
25 // CHECK-LABEL: define{{.*}} @_ZNK5SpaceeqERKS_
30 std::strong_ordering
operator<=>(Water
const &other
) const;
31 bool operator==(Water
const &other
) const;
34 // Make sure these do not cause emission
35 inline std::strong_ordering
Water::operator<=>(Water
const &other
) const = default;
36 // CHECK-NOT: define{{.*}} @_ZNK5WaterssERKS_
37 inline bool Water::operator==(Water
const &) const = default;
38 // CHECK-NOT: define{{.*}} @_ZNK5WatereqERKS_