[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenCXX / p2085.cpp
blob40f02ac6b3e735aa99768bf4caab53f40fa23e70
1 // RUN: %clang_cc1 --std=c++20 %s -emit-llvm -o - -triple x86_64-linux | FileCheck %s
3 namespace std {
4 struct strong_ordering {
5 int n;
6 constexpr operator int() const { return n; }
7 static const strong_ordering equal, greater, less;
8 };
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};
12 } // namespace std
14 struct Space {
15 int i, j;
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_
27 struct Water {
28 int i, j;
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_