annotate clang/test/SemaCXX/compare-modules-cxx2a.cpp @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900
parents 0572611fdcc8
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -I%S/Inputs %s -fno-modules-error-recovery
anatofuz
parents:
diff changeset
2
anatofuz
parents:
diff changeset
3 #pragma clang module build compare
anatofuz
parents:
diff changeset
4 module compare {
anatofuz
parents:
diff changeset
5 explicit module cmp {}
anatofuz
parents:
diff changeset
6 explicit module other {}
anatofuz
parents:
diff changeset
7 }
anatofuz
parents:
diff changeset
8 #pragma clang module contents
anatofuz
parents:
diff changeset
9 #pragma clang module begin compare.cmp
anatofuz
parents:
diff changeset
10 #include "std-compare.h"
anatofuz
parents:
diff changeset
11 #pragma clang module end
anatofuz
parents:
diff changeset
12 #pragma clang module endbuild
anatofuz
parents:
diff changeset
13
anatofuz
parents:
diff changeset
14 struct CC { CC(...); };
anatofuz
parents:
diff changeset
15
anatofuz
parents:
diff changeset
16 void a() { void(0 <=> 0); } // expected-error {{include <compare>}}
anatofuz
parents:
diff changeset
17
anatofuz
parents:
diff changeset
18 struct A {
anatofuz
parents:
diff changeset
19 CC operator<=>(const A&) const = default; // expected-error {{include <compare>}}
anatofuz
parents:
diff changeset
20 };
anatofuz
parents:
diff changeset
21 auto va = A() <=> A(); // expected-note {{required here}}
anatofuz
parents:
diff changeset
22
anatofuz
parents:
diff changeset
23 #pragma clang module import compare.other
anatofuz
parents:
diff changeset
24
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
25 // expected-note@std-compare.h:* 2+{{not reachable}}
150
anatofuz
parents:
diff changeset
26
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
27 void b() { void(0 <=> 0); } // expected-error 1+{{missing '#include "std-compare.h"'; 'strong_ordering' must be defined}}
150
anatofuz
parents:
diff changeset
28
anatofuz
parents:
diff changeset
29 struct B {
173
0572611fdcc8 reorgnization done
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
30 CC operator<=>(const B&) const = default; // expected-error 1+{{missing '#include "std-compare.h"'; 'strong_ordering' must be defined}}
150
anatofuz
parents:
diff changeset
31 };
anatofuz
parents:
diff changeset
32 auto vb = B() <=> B(); // expected-note {{required here}}
anatofuz
parents:
diff changeset
33
anatofuz
parents:
diff changeset
34 #pragma clang module import compare.cmp
anatofuz
parents:
diff changeset
35
anatofuz
parents:
diff changeset
36 void c() { void(0 <=> 0); }
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 struct C {
anatofuz
parents:
diff changeset
39 CC operator<=>(const C&) const = default;
anatofuz
parents:
diff changeset
40 };
anatofuz
parents:
diff changeset
41 auto vc = C() <=> C();
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43
anatofuz
parents:
diff changeset
44 #pragma clang module build compare2
anatofuz
parents:
diff changeset
45 module compare2 {}
anatofuz
parents:
diff changeset
46 #pragma clang module contents
anatofuz
parents:
diff changeset
47 #pragma clang module begin compare2
anatofuz
parents:
diff changeset
48 #include "std-compare.h"
anatofuz
parents:
diff changeset
49 #pragma clang module end
anatofuz
parents:
diff changeset
50 #pragma clang module endbuild
anatofuz
parents:
diff changeset
51
anatofuz
parents:
diff changeset
52 #pragma clang module import compare2
anatofuz
parents:
diff changeset
53
anatofuz
parents:
diff changeset
54 void g() { void(0.0 <=> 0.0); }