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
6 struct CC
{ CC(...); };
8 void a() { void(0 <=> 0); } // expected-error {{include <compare>}}
11 CC
operator<=>(const A
&) const = default; // expected-error {{include <compare>}}
13 auto va
= A() <=> A(); // expected-note {{required here}}
15 #pragma clang module import compare.other
17 // expected-note@std-compare.h:* 2+{{not reachable}}
19 void b() { void(0 <=> 0); } // expected-error 1+{{definition of 'strong_ordering' must be imported from module 'compare.cmp' before it is required}}
22 CC
operator<=>(const B
&) const = default; // expected-error 1+{{definition of 'strong_ordering' must be imported from module 'compare.cmp' before it is required}}
24 auto vb
= B() <=> B(); // expected-note {{required here}}
26 #pragma clang module import compare.cmp
28 void c() { void(0 <=> 0); }
31 CC
operator<=>(const C
&) const = default;
33 auto vc
= C() <=> C();
36 #pragma clang module build compare2
38 #pragma clang module contents
39 #pragma clang module begin compare2
40 #include "std-compare.h"
41 #pragma clang module end
42 #pragma clang module endbuild
44 #pragma clang module import compare2
46 void g() { void(0.0 <=> 0.0); }