1 // From [module.reach]p4, example 1
5 // RUN: split-file %s %t
7 // RUN: %clang_cc1 -std=c++20 -emit-module-interface %t/M-A.cppm -o %t/M-A.pcm
8 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/M-B-impl.cppm -o %t/M-B.pcm
9 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/M-C.cppm -fsyntax-only -verify
11 // RUN: %clang_cc1 -std=c++20 -emit-module-interface -fprebuilt-module-path=%t %t/M.cppm -o %t/M.pcm
12 // RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/X.cppm -fsyntax-only -verify
27 B b1
; // expected-error {{variable has incomplete type 'B'}}
28 // expected-note@* {{forward declaration of 'B'}}
35 export
void f(B b
= B());
40 B b3
; // expected-error {{definition of 'B' must be imported from module 'M:B' before it is required}} expected-error {{}}
41 // expected-note@* {{definition here is not reachable}} expected-note@* {{}}
42 // FIXME: We should emit an error for unreachable definition of B.
44 void g1() { f(B()); } // expected-error 1+{{definition of 'B' must be imported from module 'M:B' before it is required}}
45 // expected-note@* 1+{{definition here is not reachable}}
46 // expected-note@M.cppm:5 {{passing argument to parameter 'b' here}}