brintos

brintos / llvm-project-archived public Read only

0
0
Text · 715 B · 9242e6f Raw
23 lines · cpp
1// RUN: rm -rf %t2// RUN: mkdir -p %t3// RUN: split-file %s %t4// RUN: %clang_cc1 -std=c++20 %t/impl.cppm -emit-module-interface -o %t/M-impl.pcm5// RUN: %clang_cc1 -std=c++20 %t/M.cppm -emit-module-interface -fprebuilt-module-path=%t -o %t/M.pcm6// RUN: %clang_cc1 -std=c++20 %t/UseStrict.cpp -fprebuilt-module-path=%t -verify -fsyntax-only7 8//--- impl.cppm9module M:impl;10class A {};11 12//--- M.cppm13export module M;14import :impl;15export A f();16 17//--- UseStrict.cpp18import M;19void test() {20  auto a = f(); // expected-error {{definition of 'A' must be imported from module 'M' before it is required}} expected-error{{}}21                // expected-note@* {{definition here is not reachable}} expected-note@* {{}}22}23