26 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4//5// RUN: %clang_cc1 -std=c++20 %t/A.cppm -emit-module-interface -o %t/A.pcm6// RUN: %clang_cc1 -std=c++20 %t/B.cppm -fprebuilt-module-path=%t -emit-module-interface -o %t/B.pcm7// RUN: %clang_cc1 -fsyntax-only -std=c++20 -fprebuilt-module-path=%t -verify %t/C.cpp8 9//--- A.cppm10export module A;11export extern "C" void foo(struct Bar);12 13//--- B.cppm14module;15import A;16export module B;17 18//--- C.cpp19import B;20struct Bar {};21void test() {22 foo(Bar());23 // expected-error@-1 {{declaration of 'foo' must be imported}}24 // expected-note@A.cppm:2 {{declaration here is not visible}}25}26