[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / PCH / cxx2a-defaulted-comparison.cpp
blob8aeb1683961af30f142c48ec93d3f2ba85e4f59f
1 // RUN: %clang_cc1 -std=c++2a -verify -Wno-defaulted-function-deleted -include %s %s
2 //
3 // RUN: %clang_cc1 -std=c++2a -emit-pch %s -o %t.pch
4 // RUN: %clang_cc1 -std=c++2a -include-pch %t.pch %s -verify
5 //
6 // RUN: %clang_cc1 -std=c++2a -emit-pch -fpch-instantiate-templates %s -o %t.pch
7 // RUN: %clang_cc1 -std=c++2a -include-pch %t.pch %s -verify
9 // expected-no-diagnostics
11 #ifndef INCLUDED
12 #define INCLUDED
14 namespace std {
15 struct strong_ordering {
16 int n;
17 constexpr operator int() const { return n; }
18 static const strong_ordering equal, greater, less;
20 constexpr strong_ordering strong_ordering::equal = {0};
21 constexpr strong_ordering strong_ordering::greater = {1};
22 constexpr strong_ordering strong_ordering::less = {-1};
25 // Ensure that we can round-trip DefaultedFunctionInfo through an AST file.
26 namespace LookupContext {
27 struct A {};
29 namespace N {
30 template <typename T> auto f() {
31 bool operator==(const T &, const T &);
32 bool operator<(const T &, const T &);
33 struct B {
34 T a;
35 std::strong_ordering operator<=>(const B &) const = default;
37 return B();
42 #else
44 namespace LookupContext {
45 namespace M {
46 bool operator<=>(const A &, const A &) = delete;
47 bool operator==(const A &, const A &) = delete;
48 bool operator<(const A &, const A &) = delete;
49 bool cmp = N::f<A>() < N::f<A>();
53 #endif