4 // RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -fmodules-cache-path=%t.mcp -I%S/Inputs %s -fno-modules-error-recovery -fmodule-map-file=%S/Inputs/compare.modulemap
5 // RUN: %clang_cc1 -triple x86_64-apple-darwin -fcxx-exceptions -verify -std=c++2a -fmodules -fmodules-cache-path=%t.mcp -I%S/Inputs %s -fno-modules-error-recovery -fmodule-map-file=%S/Inputs/compare.modulemap -fexperimental-new-constant-interpreter
7 struct CC
{ CC(...); };
9 void a() { void(0 <=> 0); } // expected-error {{include <compare>}}
12 CC
operator<=>(const A
&) const = default; // expected-error {{include <compare>}}
14 auto va
= A() <=> A(); // expected-note {{required here}}
16 #pragma clang module import compare.other
18 // expected-note@std-compare.h:* 2+{{not reachable}}
20 void b() { void(0 <=> 0); } // expected-error 1+{{definition of 'strong_ordering' must be imported from module 'compare.cmp' before it is required}}
23 CC
operator<=>(const B
&) const = default; // expected-error 1+{{definition of 'strong_ordering' must be imported from module 'compare.cmp' before it is required}}
25 auto vb
= B() <=> B(); // expected-note {{required here}}
27 #pragma clang module import compare.cmp
29 void c() { void(0 <=> 0); }
32 CC
operator<=>(const C
&) const = default;
34 auto vc
= C() <=> C();
37 #pragma clang module build compare2
39 #pragma clang module contents
40 #pragma clang module begin compare2
41 #include "std-compare.h"
42 #pragma clang module end
43 #pragma clang module endbuild
45 #pragma clang module import compare2
47 void g() { void(0.0 <=> 0.0); }